/// <summary> /// Initializes a new instance of the <see cref="StructureMapAspectContainer"/> class. /// </summary> public StructureMapAspectContainer(IContainer container) { Proxy = new MasterProxy {Container = new StructureMapServiceLocator(container)}; _interceptor = new StructureMapDefinedAspectInterceptor(container); // Use "Configure", not "Initialize." Initialize overwrites existing settings container.Configure(c => { c.RegisterInterceptor(_interceptor); c.For<IMasterProxy>().Use(Proxy); }); }
//private IContainer _container; /// <summary> /// Initializes a new instance of the <see cref="StructureMapAspectContainer"/> class. /// </summary> public StructureMapAspectContainer() { Proxy = new MasterProxy(); _interceptor = new StructureMapDefinedAspectInterceptor(ObjectFactory.Container); // Use "Configure", not "Initialize." Initialize overwrites existing settings. ObjectFactory.Configure(c => { c.RegisterInterceptor(_interceptor); c.For<IMasterProxy>().Use(Proxy); }); }