I'm trying to replicate the following Ninject syntax in Unity, but not having any luck:
Bind<IIdentity>().ToMethod(c => HttpContext.Current.User.Identity);
I'm thinking it ought to look something like:
IUnityContainer container;
...
container.RegisterType<IIdentity>(HttpContext.Current.User.Identity);
How should it be?
While neontapir's answer could work, that extension method is Obsolete. The correct way to do this now would be to use an InjectionFactory: