예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public static Container Initialize()
        {
            var container = new Container();

            LoggersComponentRegistration.RegisterLoggers(container);

            ContextRegistration.RegisterContexts(container);

            MappersComponentRegistration.RegisterMappers(container);

            RepositoryComponentRegistration.RegisterRepositories(container);

            container.Verify();

            return(container);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }