public static Container Initialize() { var container = new Container(); container.Options.DefaultScopedLifestyle = new ThreadScopedLifestyle(); container.Register <IConfiguration, Configuration>(); if (AppSettingsProvider.GetUsePulseEmulator()) { container.Register <IPulseService, PulseServiceEmulator>(); } else { container.Register <IPulseService, PulseService.PulseService>(); } container.RegisterSingleton <IReactiveLoader, ReactiveLoader>(); DbComponentRegistration.RegisterDb(container); RepositoryComponentRegistration.RegisterRepositories(container); ServicesComponentRegistrations.RegisterServices(container); container.Verify(); return(container); }
public void ClassInit() { Debug.AutoFlush = true; container = new Container(); container.RegisterSingleton <Configuration>(); container.RegisterSingleton <IConfiguration>(container.GetInstance <Configuration>); container.RegisterSingleton <IDataBaseAccessor, DataBaseAccessor>(); RepositoryComponentRegistration.RegisterRepositories(container); }
public static Container Initialize() { var container = new Container(); LoggersComponentRegistration.RegisterLoggers(container); ContextRegistration.RegisterContexts(container); MappersComponentRegistration.RegisterMappers(container); RepositoryComponentRegistration.RegisterRepositories(container); container.Verify(); return(container); }
public static Container Initialize() { var container = new Container(); container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); container.RegisterSingleton <IConfiguration>(() => new Configuration()); DbComponentRegistration.RegisterDb(container); RepositoryComponentRegistration.RegisterRepositories(container); ServicesComponentRegistrations.RegisterServices(container); container.RegisterWebApiControllers(GlobalConfiguration.Configuration); container.Verify(); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); return(container); }
public static Container Initialize() { var container = new Container(); container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); container.RegisterSingleton <Configuration>(); container.RegisterSingleton <IConfiguration>(container.GetInstance <Configuration>); container.RegisterSingleton <IClient, Client>(); container.RegisterSingleton <IDataBaseAccessor, DataBaseAccessor>(); RepositoryComponentRegistration.RegisterRepositories(container); container.RegisterWebApiControllers(GlobalConfiguration.Configuration); container.Verify(); GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); return(container); }