示例#1
0
 public AzureTableSagaRepositoryContextFactory(Func <CloudTable> databaseFactory,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory)
 {
     _databaseFactory = databaseFactory;
     _factory         = factory;
     _keyFormatter    = new ConstantSagaKeyFormatter <TSaga>(typeof(TSaga).Name);
 }
 public EntityFrameworkSagaRepositoryContextFactory(ISagaDbContextFactory <TSaga> dbContextFactory,
                                                    ISagaConsumeContextFactory <DbContext, TSaga> consumeContextFactory, ISagaRepositoryLockStrategy <TSaga> lockStrategy)
 {
     _dbContextFactory      = dbContextFactory;
     _consumeContextFactory = consumeContextFactory;
     _lockStrategy          = lockStrategy;
 }
示例#3
0
 public AzureTableSagaRepositoryContextFactory(ICloudTableProvider <TSaga> cloudTableProvider,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter)
 {
     _cloudTableProvider = cloudTableProvider;
     _factory            = factory;
     _keyFormatter       = keyFormatter;
 }
 public AzureTableSagaRepositoryContextFactory(Func <CloudTable> databaseFactory,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter)
 {
     _databaseFactory = databaseFactory;
     _factory         = factory;
     _keyFormatter    = keyFormatter;
 }
 public MongoDbSagaRepositoryContext(IMongoCollection <TSaga> mongoCollection, ConsumeContext <TMessage> consumeContext,
                                     ISagaConsumeContextFactory <IMongoCollection <TSaga>, TSaga> factory)
     : base(consumeContext)
 {
     _mongoCollection = mongoCollection;
     _consumeContext  = consumeContext;
     _factory         = factory;
 }
示例#6
0
 public CosmosSagaRepositoryContext(DatabaseContext <TSaga> context, ConsumeContext <TMessage> consumeContext,
                                    ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory)
     : base(consumeContext)
 {
     _context        = context;
     _consumeContext = consumeContext;
     _factory        = factory;
 }
 public NHibernateSagaRepositoryContext(ISession session, ConsumeContext <TMessage> consumeContext,
                                        ISagaConsumeContextFactory <ISession, TSaga> factory)
     : base(consumeContext)
 {
     _session        = session;
     _consumeContext = consumeContext;
     _factory        = factory;
 }
示例#8
0
 public MartenSagaRepositoryContext(IDocumentSession session, ConsumeContext <TMessage> consumeContext,
                                    ISagaConsumeContextFactory <IDocumentSession, TSaga> factory)
     : base(consumeContext)
 {
     _session        = session;
     _consumeContext = consumeContext;
     _factory        = factory;
 }
        public RedisSagaRepositoryContextFactory(Func <IDatabase> databaseFactory, ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                                 RedisSagaRepositoryOptions <TSaga> options)
        {
            _databaseFactory = databaseFactory;

            _factory = factory;
            _options = options;
        }
 public DbContextSagaRepositoryContext(DbContext dbContext, ConsumeContext <TMessage> consumeContext,
                                       ISagaConsumeContextFactory <DbContext, TSaga> factory, ISagaRepositoryLockStrategy <TSaga> lockStrategy)
     : base(consumeContext, dbContext)
 {
     _dbContext      = dbContext;
     _consumeContext = consumeContext;
     _factory        = factory;
     _lockStrategy   = lockStrategy;
 }
示例#11
0
 public InMemorySagaRepositoryContext(IndexedSagaDictionary <TSaga> sagas, ISagaConsumeContextFactory <IndexedSagaDictionary <TSaga>, TSaga> factory,
                                      ConsumeContext <TMessage> context)
     : base(context)
 {
     _sagas       = sagas;
     _factory     = factory;
     _context     = context;
     _sagasLocked = true;
 }
        public RedisSagaRepositoryContextFactory(ConnectionMultiplexer multiplexer, ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                                 RedisSagaRepositoryOptions <TSaga> options)
        {
            _multiplexer     = multiplexer;
            _databaseFactory = GetDatabase;

            _factory = factory;
            _options = options;
        }
示例#13
0
        public RedisSagaRepositoryContextFactory(ConnectionMultiplexer multiplexer, ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                                 RedisSagaRepositoryOptions <TSaga> options)
        {
            IDatabase DatabaseFactory() => options.DatabaseSelector(multiplexer);

            _databaseFactory = DatabaseFactory;

            _factory = factory;
            _options = options;
        }
        public MessageSessionSagaRepositoryContext(ConsumeContext <TMessage> consumeContext, ISagaConsumeContextFactory <MessageSessionContext, TSaga> factory)
            : base(consumeContext)
        {
            if (!consumeContext.TryGetPayload(out MessageSessionContext sessionContext))
            {
                throw new SagaException($"The session-based saga repository requires an active message session: {TypeMetadataCache<TSaga>.ShortName}",
                                        typeof(TSaga), typeof(TMessage));
            }

            _consumeContext = consumeContext;
            _sessionContext = sessionContext;
            _factory        = factory;
        }
示例#15
0
 public DapperSagaRepositoryContextFactory(DapperOptions <TSaga> options, ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory)
 {
     _options = options;
     _factory = factory;
 }
示例#16
0
 public NHibernateSagaRepositoryContextFactory(ISessionFactory sessionFactory, ISagaConsumeContextFactory <ISession, TSaga> factory)
 {
     _sessionFactory = sessionFactory;
     _factory        = factory;
 }
 public MongoDbSagaRepositoryContextFactory(IMongoCollection <TSaga> mongoCollection, ISagaConsumeContextFactory <IMongoCollection <TSaga>, TSaga> factory)
 {
     _mongoCollection = mongoCollection;
     _factory         = factory;
 }
 public CosmosSagaRepositoryContextFactory(DatabaseContext <TSaga> context, ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory)
 {
     _context = context;
     _factory = factory;
 }
 public AzureTableSagaRepositoryContextFactory(CloudTable databaseFactory,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter) :
     this(() => databaseFactory, factory, keyFormatter)
 {
 }
示例#20
0
 public InMemorySagaRepositoryContextFactory(IndexedSagaDictionary <TSaga> sagas, ISagaConsumeContextFactory <IndexedSagaDictionary <TSaga>, TSaga> factory)
 {
     _sagas   = sagas;
     _factory = factory;
 }
示例#21
0
 public AzureTableSagaRepositoryContextFactory(CloudTable cloudTable,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter)
     : this(new ConstCloudTableProvider <TSaga>(cloudTable), factory, keyFormatter)
 {
 }
示例#22
0
 public MessageSessionSagaRepositoryContextFactory(ISagaConsumeContextFactory <MessageSessionContext, TSaga> factory)
 {
     _factory = factory;
 }
示例#23
0
 public MartenSagaRepositoryContextFactory(IDocumentStore documentStore, ISagaConsumeContextFactory <IDocumentSession, TSaga> factory)
 {
     _documentStore = documentStore;
     _factory       = factory;
 }