c# - Can i create OwinMiddleware per request instead creating a global object -


i'm working on webapi project & migrating owin/katana hosting. have few doubts regarding.

quest ) can create owinmiddleware per request instead creating global object?

i'm able create owinmiddleware not able create them per request. wanted create them per request can insert new object in owinmiddleware dependency. i'm using unity in webapi wanted solution aligned unity.

i found few links :-

http://alexmg.com/owin-support-for-the-web-api-2-and-mvc-5-integrations-in-autofac/

http://www.tugberkugurlu.com/archive/owin-dependencies--an-ioc-container-adapter-into-owin-pipeline

but not able adjust new ioc old unity. can suggest solution

i found way achive :-

        app.use((iowincontext context, func<task> next) =>         {             ilogger logger = {resolve dependency using unity};             customowinmiddleware middleware = new customowinmiddleware(context,next, logger);             return middleware.invoke();         }); 

by way i'm able generate middle ware per request. right way ?


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -