How to pass Owin context to a Repo being injected into Api controller

后端 未结 4 478
挽巷
挽巷 2020-12-08 21:52

I\'ve got a MVC WebApi owin (soft hosted) project, that uses Unity for resolving controller dependencies

which look like this

public class PacientaiC         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 21:58

    In a selfhosted application you do not have a HttpContext. You need an other way to move the state around. An option is to use a self implemented HttpContext like:

    https://github.com/danielcrenna/graveyard/tree/master/httpcontext-shim

提交回复
热议问题