OWIN app.use vs app.run vs app.map

拜拜、爱过 提交于 2019-12-21 06:59:20

问题


What's the difference among app.use, app.run, app.map in Owin? When to use what? It's not straightforward when reading the documentation.


回答1:


app.use inserts a middleware into the pipeline which requires you to call the next middleware by calling next.Invoke().

app.run inserts a middleware without a next, so it just runs.

With app.map you can map paths, which get evaluated at runtime, per request, to run certain middleware only if the request path matches the pattern you mapped.

See docs for use and run and map for more details



来源:https://stackoverflow.com/questions/35559763/owin-app-use-vs-app-run-vs-app-map

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