I'm looking for a way to dynamically generate web apis and add them at runtime (after selfhosted server has been initialized).
Basically the idea would be to: 1. Create a selfhost owin server serving static/already defined controllers (web apis) -> this part is ok
At a later time, I want to dynamically generate a new controller and add it somehow to the server so that client can send request to it. -> is there a way to do that? I know I can dynamically build a controller and add it to the server BEFORE it is initialized to serves existing web apis (using CustomAssemblyResolver).
Now existing controller may need to be updated. I would like to re-generate an existing controller and update the server to use the new definition (maybe parameter change, name of apis changed, etc.) Any way to do that? Can we recycle a controller without stopping all the controllers? If somehow this can be supported, do it mean the service will not be available for some time (until the update is done).
Ideally it would work like web service hosted in IIS. If web service definition change between 2 requests. 1st request go to old definition and 2nd request is transparently directed to new definition. There is no interruption of service.
Any ideas?
Thanks in advance