public static ISessionFactory CreateSessionFactory()
		{
			var provider = new SqlServerSessionFactoryProvider(ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString, new[]
			{
				typeof (MySagaMap)
			});
			return provider.GetSessionFactory();
		}
Пример #2
0
        public void Setup()
        {
            var provider =
                new SqlServerSessionFactoryProvider(
                    "Application Name=Burrows.Tests;Connect Timeout=30;Connection Lifetime=300;Database=Hydro;Server=.;Integrated Security=SSPI;",
                    new[]
            {
                typeof(ConcurrentSagaMap)
            });

            _sessionFactory = provider.GetSessionFactory();

            using (ISession session = _sessionFactory.OpenSession())
                using (ITransaction tx = session.BeginTransaction())
                {
                    session.Delete("from ConcurrentSaga cs");
                    session.Flush();
                    tx.Commit();
                }
        }
Пример #3
0
        private static Action <ServiceBusConfigurator> Config()
        {
            return(sbc =>
            {
                sbc.UseLog4Net();
                sbc.UseRabbitMq();
                sbc.ReceiveFrom("rabbitmq://localhost/greeting_saga");



                var sessionFactory =
                    new SqlServerSessionFactoryProvider(
                        @"Data Source=.\SQLExpress;Initial Catalog=auctiondb;Integrated Security=True;Enlist=false",
                        new[] { typeof(AuctionSagaMap) }).GetSessionFactory();


                sbc.Subscribe(
                    subs => subs.Saga(new NHibernateSagaRepository <AuctionSaga>(sessionFactory)));
            });
        }
Пример #4
0
        public void Setup()
        {
            var provider =
                new SqlServerSessionFactoryProvider(
                    "Application Name=MassTransit.Tests;Connect Timeout=30;Connection Lifetime=300;Database=Hydro;Server=.;Integrated Security=SSPI;",
                    new[]
                        {
                            typeof(ConcurrentSagaMap)
                        });

            _sessionFactory = provider.GetSessionFactory();

            using (ISession session = _sessionFactory.OpenSession())
            using (ITransaction tx = session.BeginTransaction())
            {
                session.Delete("from ConcurrentSaga cs");
                session.Flush();
                tx.Commit();
            }
        }