Exemplo n.º 1
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            container.RegisterType<ISphereService, SphereServiceFake>(new ContainerControlledLifetimeManager());
            container.RegisterControllers();

            return container;
        }
Exemplo n.º 2
0
		private static IUnityContainer BuildUnityContainer()
		{
			var container = new UnityContainer();
			
			container.RegisterType<ICode9Service, Code9Service>();
			container.RegisterType<Code9Entities>(new HierarchicalLifetimeManager());
			container.RegisterControllers();

			return container;
		}
Exemplo n.º 3
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // e.g. container.RegisterType<ITestService, TestService>();

            container.RegisterControllers();

            return container;
        }
Exemplo n.º 4
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            Repository.Bootstrapper.Init(container);

            Logger.Bootstrapper.Init(container);

            container.RegisterControllers();

            return container;
        }
Exemplo n.º 5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            var container = new UnityContainer();

            container.RegisterType<MongoWrapper>(new HierarchicalLifetimeManager());
            container.RegisterControllers();

            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
        }
Exemplo n.º 6
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // e.g. container.RegisterType<ITestService, TestService>();
            container.RegisterType<IDatabaseFactory, DatabaseFactory>(new HierarchicalLifetimeManager());
            container.RegisterType<IUnitOfWork, UnitOfWork>();
            container.RegisterType<IPeopleRepository, PeopleRepository>();
            container.RegisterType<IPeopleService, PeopleService>();
            container.RegisterControllers();

            return container;
        }
Exemplo n.º 7
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // e.g. container.RegisterType<ITestService, TestService>();

            container.RegisterControllers();
            container.RegisterType<IProjectRepository, ProjectRepository>();
            container.RegisterType<ICasesRepository, CasesRepository>();
            container.RegisterType<ITestStates, TestStates>();
            container.RegisterType<IStatisticRepository, StatisticRepository>();

            return container;
        }
Exemplo n.º 8
0
        private static IUnityContainer BuildUnityContainer()
        {
            // Unity Container
            var container = new UnityContainer();

            // Add controllers
            container.RegisterControllers();

            // register the services: https://github.com/gzak/Unity.Mvc.Wcf
            container.RegisterWcfClientFor<ITaskService>("BasicHttpBinding_ITaskService");

            // Register the gateways
            container.RegisterType<ITaskGateway, TaskGateway>(
                            new HierarchicalLifetimeManager(),
                            new InjectionConstructor(container.Resolve<ITaskService>()));

            return container;
        }
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // register all your components with the container here
            // e.g. container.RegisterType<ITestService, TestService>();
            container.RegisterType<ICustomerRepository, CustomerRepository>(new HierarchicalLifetimeManager());
            container.RegisterType<IOrderRepository, OrderRepository>(new HierarchicalLifetimeManager());
            container.RegisterType<IShipTypeRepository, ShipTypeRepository>(new HierarchicalLifetimeManager());
            container.RegisterType<IStateRepository, StateRepository>(new HierarchicalLifetimeManager());

            //Does not implement IDisposable so we do not need a HierarchicalLifetimeManager
            container.RegisterType<ICustomerValidator, ICustomerValidator>();

            container.RegisterControllers();

            return container;
        }
Exemplo n.º 10
0
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            container
                .RegisterType<IDatabaseFactory, DatabaseFactory>(new HierarchicalLifetimeManager())
                .RegisterType<IUnitOfWork, UnitOfWork>(new HierarchicalLifetimeManager())
                .RegisterType<ISiteSettingsRepository, SiteSettingsRepository>(new HierarchicalLifetimeManager())
                .RegisterType<ICategoryRepository, CategoryRepository>(new HierarchicalLifetimeManager())
                .RegisterType<ISettingsService, SettingsService>(new HierarchicalLifetimeManager())
                .RegisterType<ITopicsRepository, TopicsRepository>(new HierarchicalLifetimeManager())
                .RegisterType<ISectionsRepository, SectionsRepository>(new HierarchicalLifetimeManager())
                .RegisterType<ISectionsService, SectionsService>(new HierarchicalLifetimeManager())
                .RegisterType<IConfigService, ConfigService>(new HierarchicalLifetimeManager());

            container.RegisterControllers();

            return container;
        }