Container
Container.Resolve
new Container()
Funq.StaticContainer
Thanks to Mythz for the hints of gist , a) or b) or c).
I use the Mythz solution, it is accepted by me, but there are problems for its ServiceLocatorPattern, you can check additional information here .
ServiceLocator
AppHost. IAppHost :
HostContext.TryResolve<T>(); HostContext.Resolve<T>(); HostContext.AppHost.TryResolve<T>();
- Funq.Container, singleton:
Funq.Container
ServiceStackHost.Instance.Container
, Razor .. :
base.TryResolve<T>();