using GeneralApi.IntegrationUtility.Common; using log4net; using log4net.Core; using Microsoft.Practices.ServiceLocation; using StructureMap; using StructureMap.ServiceLocatorAdapter; using Taloyhtio.GeneralApi.Common.DTO; using Taloyhtio.GeneralApi.IntegrationUtility.Repositories; using Taloyhtio.GeneralApi.IntegrationUtility.Repositories.Impl; using Taloyhtio.GeneralApi.IntegrationUtility.Services; using Taloyhtio.GeneralApi.IntegrationUtility.Services.Impl; namespace GeneralApi.IntegrationUtility.Infrastructure { public class IoCConfiguration { public static void Configure() { ObjectFactory.Initialize( x => { x.ForRequestedType() .AsSingletons() .TheDefault.Is.ConstructedBy(ctx => LogManager.GetLogger(Constants.Logger.LOGGER_NAME)); x.ForRequestedType() .TheDefaultIsConcreteType(); x.ForRequestedType() .TheDefaultIsConcreteType(); x.ForRequestedType>() .TheDefaultIsConcreteType>(); x.ForRequestedType>() .TheDefaultIsConcreteType>(); x.ForRequestedType>() .TheDefaultIsConcreteType>(); x.ForRequestedType>() .TheDefaultIsConcreteType>(); x.ForRequestedType>() .TheDefaultIsConcreteType(); x.ForRequestedType>() .TheDefaultIsConcreteType(); x.ForRequestedType() .TheDefaultIsConcreteType(); x.ForRequestedType() .TheDefaultIsConcreteType(); }); var locator = new StructureMapServiceLocator(ObjectFactory.Container); ServiceLocator.SetLocatorProvider(() => locator); } } }