Anatomy of an OWIN Startup

我们两清 提交于 2019-12-01 04:41:05

It's not so much a "hook" as it is a convention. There is a good article on this here:

http://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection

As for why there is no interface, most likely it's because there was no need to lock it down to that level. This is largely reflection based, and you can specify the class and method to use for startup by various configuration parameters.

In the case of WebAPI in the example you link to, you can do so in the WebApp.Start method, and specify StartOptions with the name of the method to use, but the convention is Configuration.

Cleanup can be accomplished by getting the cancelation token. This information is in the documentation, which is linked from the examples you show. I'm not sure I understand how you arrive at the conclusion that the documentation is missing when it's clearly not.

http://msdn.microsoft.com/en-us/library/microsoft.owin.builderproperties.appproperties.onappdisposing(v=vs.113).aspx

Certainly, it's missing elaboration and examples... but there are a lot of blog entries about this stuff...

You may also want to read the OWIN specification:

http://owin.org/spec/spec/owin-1.0.0.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!