public void Init(HttpApplication context)
 {
     context.BeginRequest += (s, e) => StructureMapScope.AddContainer();
     context.EndRequest   += (s, e) => StructureMapScope.RemoveContainer();
 }
Esempio n. 2
0
        public object GetService(Type serviceType)
        {
            var container = StructureMapScope.GetContainer() ?? root;

            return(ShouldResolveInstance(serviceType) ? container.GetInstance(serviceType) : DefaultCreateInstance(serviceType));
        }