Пример #1
0
        public static void Activate()
        {
            Container = ServiceContainerFactory.CreateUnityContainer();

            Container.RegisterType <IUserRepository, UserRepository>(new ContainerControlledLifetimeManager());
            Container.RegisterType <UserContext, UserContext>(new ContainerControlledLifetimeManager());
            Container.RegisterType <IMailer, Mailer>(new ContainerControlledLifetimeManager());

#if DEBUG
            Container.RegisterType <IUserRepository, FakeUserRepository>(new ContainerControlledLifetimeManager());
#endif
        }
Пример #2
0
 private void ConfigureServices()
 {
     services = ServiceContainerFactory.Create();
     SetupGeneratorStarterServices(services);
     SetupViewServices(services);
 }