Esempio n. 1
0
 /// <summary>
 /// NHibernate 용 Domain을 테스트하기 위해, 환경을 초기화합니다.
 /// </summary>
 /// <param name="containerConfigPath">Castle Windsor configuration file path</param>
 /// <param name="mappingInfo">Domain Model의 Mapping information</param>
 /// <param name="configAction">부가적인 Configuration 관련 작업 (Listener 추가 등)</param>
 /// <param name="conventions">Fluent NHibernate의 명명규칙</param>
 public static void InitializeNHibernateAndIoC(string containerConfigPath,
                                               MappingInfo mappingInfo,
                                               Action <NHibernate.Cfg.Configuration> configAction,
                                               params IConvention[] conventions)
 {
     NHibernateInitializer.Initialize(mappingInfo, configAction, conventions).AndIoC(containerConfigPath);
 }
 /// <summary>
 /// Initialize the persistence framework, build a session factory, and
 /// initialize the container. If <paramref name="rhinoContainerConfig"/>
 /// is <see langword="null" /> or <see cref="string.Empty">string.Empty</see>
 ///  a <see cref="RhinoContainer">RhinoContainer</see> will not be initialized.
 /// </summary>
 /// <param name="framework">The persistence framework</param>
 /// <param name="rhinoContainerConfig">The configuration file to initialize a
 /// <see cref="RhinoContainer">RhinoContainer</see> or <see langword="null" />.</param>
 /// <param name="databaseName">Name of the database or <see langword="null" />.</param>
 /// <param name="databaseEngine">The database engine that tests should be performed against</param>
 /// <param name="mappingInfo">Information used to map classes to database tables and queries.</param>
 /// <remarks>
 /// If <paramref name="databaseName"/> is <see langword="null" /> or
 /// <see cref="string.Empty"/> a database with a name
 /// derived from the other parameters supplied will be created. See
 /// <see cref="NHibernateInitializer.DeriveDatabaseNameFrom(Assembly)"/> and <see cref="NHibernateInitializer.DeriveDatabaseNameFrom(DatabaseEngine, Assembly)"/>
 /// </remarks>
 public static void InitializeNHibernateAndIoC(PersistenceFramework framework,
                                               string rhinoContainerConfig,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo).Using(databaseEngine, databaseName).AndIoC(
         rhinoContainerConfig);
 }
 /// <summary>
 /// NHibernate 용 Domain을 테스트하기 위해, 환경을 초기화합니다.
 /// </summary>
 /// <param name="containerConfigPath">Castle Windsor configuration file path</param>
 /// <param name="databaseEngine">Database 종류</param>
 /// <param name="mappingInfo">Domain Model의 Mapping information</param>
 /// <param name="configAction">부가적인 Configuration 관련 작업 (Listener 추가 등)</param>
 public static void InitializeNHibernateAndIoC(string containerConfigPath,
                                               DatabaseEngine databaseEngine,
                                               MappingInfo mappingInfo,
                                               Action <NHibernate.Cfg.Configuration> configAction)
 {
     NHibernateInitializer.Initialize(mappingInfo, configAction)
     .Using(databaseEngine, null)
     .AndIoC(containerConfigPath);
 }
 /// <summary>
 /// NHibernate 용 Domain을 테스트하기 위해, 환경을 초기화합니다.
 /// </summary>
 /// <param name="containerConfigPath">Castle Windsor configuration file path</param>
 /// <param name="databaseEngine">Database 종류</param>
 /// <param name="databaseName">Database name</param>
 /// <param name="mappingInfo">Domain Model의 Mapping information</param>
 /// <param name="properties">NHibernate configuration 정보</param>
 public static void InitializeNHibernateAndIoC(string containerConfigPath,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo,
                                               IDictionary <string, string> properties)
 {
     NHibernateInitializer.Initialize(mappingInfo, null)
     .Using(databaseEngine, databaseName)
     .ConfiguredBy(properties)
     .AndIoC(containerConfigPath);
 }
 /// <summary>
 /// See <see cref="InitializeNHibernateAndIoC(PersistenceFramework,string,DatabaseEngine,string,MappingInfo)" />
 /// </summary>
 public static void InitializeNHibernateAndIoC(PersistenceFramework framework,
                                               string rhinoContainerConfig,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo,
                                               IDictionary <string, string> properties)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo)
     .Using(databaseEngine, databaseName)
     .ConfiguredBy(properties)
     .AndIoC(rhinoContainerConfig);
 }
Esempio n. 6
0
        public static void Initialize()
        {
            var container = new Container(x => {
                x.For <ISessionFactory>()
                .Singleton()
                .Use(() => NHibernateInitializer.Initialize().BuildSessionFactory());
                x.For <IEntityDuplicateChecker>().Use <EntityDuplicateChecker>();
                x.For(typeof(IRepository)).Use(typeof(Repository));
            });

            DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
        }
Esempio n. 7
0
 /// <summary>
 /// NHibernate 용 Domain을 테스트하기 위해, 환경을 초기화합니다.
 /// </summary>
 /// <param name="containerConfigPath">Castle Windsor configuration file path</param>
 /// <param name="databaseEngine">Database 종류</param>
 /// <param name="databaseName">Database name</param>
 /// <param name="mappingInfo">Domain Model의 Mapping information</param>
 /// <param name="configAction">configuration 부가 작업</param>
 /// <param name="conventions">Fluent NHibernate의 명명규칙</param>
 public static void InitializeNHibernateAndIoC(string containerConfigPath,
                                               DatabaseEngine databaseEngine,
                                               string databaseName,
                                               MappingInfo mappingInfo,
                                               Action <NHibernate.Cfg.Configuration> configAction,
                                               params IConvention[] conventions)
 {
     NHibernateInitializer
     .Initialize(mappingInfo, configAction, conventions)
     .Using(databaseEngine, databaseName)
     .AndIoC(containerConfigPath);
 }
Esempio n. 8
0
        public static void Initialize()
        {
            _container = new Container(x => {
                x.For <ISessionFactory>()
                .Singleton()
                .Use(() => NHibernateInitializer.Initialize().BuildSessionFactory());
                x.For <IEntityDuplicateChecker>().Use <EntityDuplicateChecker>();
                x.For(typeof(IRepository <>)).Use(typeof(Repository <>));
                // Even if you don't use this, it's needed by the SharpModelBinder
                x.For(typeof(IRepositoryWithTypedId <,>)).Use(typeof(RepositoryWithTypedId <,>));
            });

            DependencyResolver.SetResolver(new StructureMapDependencyResolver(_container));
        }
 public static void Initialize()
 {
     Container = new Container(x => {
         x.For <ISessionFactory>()
         .Singleton()
         .Use(() => NHibernateInitializer.Initialize().BuildSessionFactory());
         x.For <IEntityDuplicateChecker>().Use <EntityDuplicateChecker>();
         x.For(typeof(IRepository <>)).Use(typeof(Repository <>));
         x.For(typeof(IRepositoryWithTypedId <,>)).Use(typeof(RepositoryWithTypedId <,>));
         x.For(typeof(IItemRepository)).Use(typeof(ItemRepository));
         x.For(typeof(IQuestRepository)).Use(typeof(QuestRepository));
         x.For(typeof(INonPlayerEntityRepository)).Use(typeof(NonPlayerEntityRespository));
         x.For(typeof(ICharacterRepository)).Use(typeof(CharacterRepository));
         x.For(typeof(GoalSetter)).Use(typeof(GoalSetter));
         x.For(typeof(IRomMessageProcessor)).Use(typeof(RomMessageProcessor));
     });
 }
        public static void Initialize()
        {
            Container container = new Container(x => {
                x.For <ISessionFactory>()
                .Singleton()
                .Use(() => NHibernateInitializer.Initialize().BuildSessionFactory());
                x.For <IEntityDuplicateChecker>().Use <EntityDuplicateChecker>();
                x.For(typeof(IRepository <>)).Use(typeof(Repository <>));
                x.For(typeof(IRepositoryWithTypedId <,>)).Use(typeof(RepositoryWithTypedId <,>));

                // This is a very exceptional case and you'd almost never be doing this; you'd
                // istead be using concreate query objects (e.g., MyStore.Domain.Queries.FindActiveCustomers)
                x.For <IQueryForProductOrderSummaries>().Use <QueryForProductOrderSummaries>();
            });

            DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
        }
 public virtual void SetUp()
 {
     _configuration  = NHibernateInitializer.Initialize();
     _sessionFactory = _configuration.BuildSessionFactory();
 }
Esempio n. 12
0
 public virtual void SetUp()
 {
     NHibernateInitializer.ResetCache();
     configuration  = NHibernateInitializer.Initialize();
     sessionFactory = configuration.BuildSessionFactory();
 }
 /// <summary>
 /// See <see cref="InitializeNHibernateAndIoC(PersistenceFramework,string,DatabaseEngine,string,MappingInfo)"/>
 /// </summary>
 public static void InitializeNHibernate(PersistenceFramework framework, MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo);
 }
 /// <summary>
 /// See <see cref="InitializeNHibernateAndIoC(PersistenceFramework,string,DatabaseEngine,string,MappingInfo)"/>
 /// </summary>
 public static void InitializeNHibernateAndIoC(PersistenceFramework framework, string rhinoContainerConfig, MappingInfo mappingInfo)
 {
     NHibernateInitializer.Initialize(framework, mappingInfo).AndIoC(rhinoContainerConfig);
 }
Esempio n. 15
0
 /// <summary>
 /// NHibernate 를 초기화 한다.
 /// </summary>
 /// <param name="mappingInfo">엔티티 매핑 정보</param>
 /// <param name="configAction">환경설정 추가 작업용 델리게이트</param>
 /// <param name="conventions">Fluent NHibernate의 명명규칙</param>
 public static void InitializeNHibernate(MappingInfo mappingInfo,
                                         Action <NHibernate.Cfg.Configuration> configAction,
                                         params IConvention[] conventions)
 {
     NHibernateInitializer.Initialize(mappingInfo, configAction, conventions);
 }
 /// <summary>
 /// NHibernate 를 초기화 한다.
 /// </summary>
 /// <param name="mappingInfo">엔티티 매핑 정보</param>
 /// <param name="configAction">환경설정 추가 작업용 델리게이트</param>
 public static void InitializeNHibernate(MappingInfo mappingInfo, Action <NHibernate.Cfg.Configuration> configAction)
 {
     NHibernateInitializer.Initialize(mappingInfo, configAction);
 }