Пример #1
0
        public void SetUp()
        {
            var nhibernateProperties = SQLiteConfiguration.UsingFile(Path.GetTempFileName());

            SessionFactory = new SessionFactoryBuilder(typeof(TestSaga).Assembly.GetTypes())
                .Build(nhibernateProperties, true);

            SagaPersister = new SagaPersister { SessionFactory = SessionFactory };

            UnitOfWork = new UnitOfWorkManager { SessionFactory = SessionFactory };
        }
Пример #2
0
        public void SetUp()
        {
            var nhibernateProperties = SQLiteConfiguration.UsingFile(Path.GetTempFileName());

            SessionFactory = new SessionFactoryBuilder(typeof(TestSaga).Assembly.GetTypes())
                             .Build(nhibernateProperties, true);

            SagaPersister = new SagaPersister {
                SessionFactory = SessionFactory
            };

            UnitOfWork = new UnitOfWorkManager {
                SessionFactory = SessionFactory
            };
        }
Пример #3
0
        public void SetUp()
        {
            string connectionString = String.Format(@"Data Source={0};Version=3;New=True;", Path.GetTempFileName());

            Configure.ConfigurationSource = new FakeConfigurationSource();

            NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
            {
                { "NServiceBus/Persistence/NHibernate/dialect", dialect }
            };

            NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
            {
                new ConnectionStringSettings("NServiceBus/Persistence/NHibernate/Saga", connectionString)
            };

            ConfigureNHibernate.Init();

            Configure.Features.Enable <Features.Sagas>();

            var types = typeof(TestSaga).Assembly.GetTypes().ToList();

            types.Add(typeof(ContainSagaData));

            Configure.With(types)
            .DefineEndpointName("Foo")
            .DefaultBuilder()
            .UseNHibernateSagaPersister();

            var builder    = new SessionFactoryBuilder(Configure.TypesToScan);
            var properties = ConfigureNHibernate.SagaPersisterProperties;

            SessionFactory = builder.Build(ConfigureNHibernate.CreateConfigurationWith(properties));

            UnitOfWork = new UnitOfWorkManager {
                SessionFactory = SessionFactory
            };

            SagaPersister = new SagaPersister {
                UnitOfWorkManager = (UnitOfWorkManager)UnitOfWork
            };

            new Installer().Install(WindowsIdentity.GetCurrent().Name);
        }
Пример #4
0
        public void SetUp()
        {
            string connectionString = String.Format(@"Data Source={0};Version=3;New=True;", Path.GetTempFileName());

            Configure.ConfigurationSource = new FakeConfigurationSource();

            NHibernateSettingRetriever.AppSettings = () => new NameValueCollection
                                                               {
                                                                   {"NServiceBus/Persistence/NHibernate/dialect", dialect}
                                                               };

            NHibernateSettingRetriever.ConnectionStrings = () => new ConnectionStringSettingsCollection
                                                                     {
                                                                         new ConnectionStringSettings("NServiceBus/Persistence/NHibernate/Saga", connectionString)
                                                                     };

            ConfigureNHibernate.Init();

            Configure.Features.Enable<Features.Sagas>();

            var types = typeof(TestSaga).Assembly.GetTypes().ToList();
            types.Add(typeof(ContainSagaData));

            Configure.With(types)
                .DefineEndpointName("Foo")
                .DefaultBuilder()
                .UseNHibernateSagaPersister();

            var builder = new SessionFactoryBuilder(Configure.TypesToScan);
            var properties = ConfigureNHibernate.SagaPersisterProperties;

            SessionFactory = builder.Build(ConfigureNHibernate.CreateConfigurationWith(properties));

            UnitOfWork = new UnitOfWorkManager { SessionFactory = SessionFactory };

            SagaPersister = new SagaPersister { UnitOfWorkManager = (UnitOfWorkManager)UnitOfWork };

            new Installer().Install(WindowsIdentity.GetCurrent().Name);
        }
Пример #5
0
 protected void RegisterUow(IManageUnitsOfWork uow)
 {
     FuncBuilder.Register <IManageUnitsOfWork>(() => uow);
 }