Ejemplo n.º 1
0
        private static void application_AppInitEvent(IConfigSource source, IObjectContainer objectContainer)
        {
            var c = objectContainer.GetRealObjectContainer<UnityContainer>();
            c.RegisterType<INHibernateConfiguration, NHibernateConfiguration>(new InjectionConstructor(GetNHibernateConfig()));
            c.RegisterType<IRepositoryContext, NHibernateContext>(new InjectionConstructor(new ResolvedParameter<INHibernateConfiguration>()));

            c.RegisterType<IUserService, UserService>();
            c.RegisterType<IUserRepository, UserRepository>();
            c.RegisterType<IMenuService, MenuService>();
            c.RegisterType<IMenuRepository, MenuRepository>();
        }
Ejemplo n.º 2
0
        private static void application_AppInitEvent(IConfigSource source, IObjectContainer objectContainer)
        {
            var c = objectContainer.GetRealObjectContainer <UnityContainer>();

            c.RegisterType <INHibernateConfiguration, NHibernateConfiguration>(new InjectionConstructor(GetNHibernateConfig()));
            c.RegisterType <IRepositoryContext, NHibernateContext>(new InjectionConstructor(new ResolvedParameter <INHibernateConfiguration>()));

            c.RegisterType <IUserService, UserService>();
            c.RegisterType <IUserRepository, UserRepository>();
            c.RegisterType <IMenuService, MenuService>();
            c.RegisterType <IMenuRepository, MenuRepository>();
        }
Ejemplo n.º 3
0
        private static void application_AppInitEvent(IConfigSource source, IObjectContainer objectContainer)
        {
            Assert.AreEqual(
                AppRuntime.Instance.CurrentApplication.ObjectContainer.GetRealObjectContainer <UnityContainer>(),
                AppRuntime.Instance.CurrentApplication.ObjectContainer.GetRealObjectContainer <UnityContainer>());

            var c = objectContainer.GetRealObjectContainer <UnityContainer>();

            c.RegisterType <INHibernateConfiguration, NHibernateConfiguration>(
                new InjectionConstructor(Helper.SetupNHibernateDatabase()));
            c.RegisterType <IRepositoryContext, NHibernateContext>(
                new InjectionConstructor(new ResolvedParameter <INHibernateConfiguration>()));
        }
Ejemplo n.º 4
0
        private static void application_AppInitEvent(IConfigSource source, IObjectContainer objectContainer)
        {
            Assert.AreEqual(
                AppRuntime.Instance.CurrentApplication.ObjectContainer.GetRealObjectContainer<UnityContainer>(),
                AppRuntime.Instance.CurrentApplication.ObjectContainer.GetRealObjectContainer<UnityContainer>());

            var c = objectContainer.GetRealObjectContainer<UnityContainer>();
            c.RegisterType<INHibernateConfiguration, NHibernateConfiguration>(
                new InjectionConstructor(Helper.SetupNHibernateDatabase()));
            c.RegisterType<IRepositoryContext, NHibernateContext>(
                new InjectionConstructor(new ResolvedParameter<INHibernateConfiguration>()));
        }