I\'ve got a MVC WebApi owin (soft hosted) project, that uses Unity for resolving controller dependencies
which look like this
public class PacientaiC
I think the problem is that HttpContext does not exist at the time Startup is called, so what you probably need, is to have a Func instead, like this:
public class PacientasEntityRepo:IEntityRepo,IDisposable
{
public PacientasEntityRepo(Func ctx)
{
.........
and then change the code in Startup to this:
Container.RegisterType(new InjectionFactory(() => HttpContext.Current.GetOwinContext()));