Example #1
0
 public AzureTableSagaRepositoryContextFactory(Func <CloudTable> databaseFactory,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory)
 {
     _databaseFactory = databaseFactory;
     _factory         = factory;
     _keyFormatter    = new ConstantSagaKeyFormatter <TSaga>(typeof(TSaga).Name);
 }
Example #2
0
        public AzureTableDatabaseContext(CloudTable table, ISagaKeyFormatter <TSaga> keyFormatter)
        {
            Table     = table;
            Formatter = keyFormatter;

            Converter = EntityConverterFactory.CreateConverter <TSaga>();
        }
Example #3
0
        public static ISagaRepository <TSaga> Create(Func <CloudTable> tableFactory, ISagaKeyFormatter <TSaga> keyFormatter)
        {
            var consumeContextFactory = new SagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga>();

            var repositoryContextFactory = new AzureTableSagaRepositoryContextFactory <TSaga>(tableFactory, consumeContextFactory, keyFormatter);

            return(new SagaRepository <TSaga>(repositoryContextFactory));
        }
Example #4
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;
 }
Example #6
0
        public static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator,
                                                       Func <CloudTable> contextFactory,
                                                       ISagaKeyFormatter <JobTypeSaga> jobTypeKeyFormatter,
                                                       ISagaKeyFormatter <JobSaga> jobKeyFormatter,
                                                       ISagaKeyFormatter <JobAttemptSaga> jobAttemptKeyFormatter)
        {
            configurator.Repository = AzureTableSagaRepository <JobTypeSaga> .Create(contextFactory, jobTypeKeyFormatter);

            configurator.JobRepository = AzureTableSagaRepository <JobSaga> .Create(contextFactory, jobKeyFormatter);

            configurator.JobAttemptRepository = AzureTableSagaRepository <JobAttemptSaga> .Create(contextFactory, jobAttemptKeyFormatter);
        }
 public AzureTableDatabaseContext(CloudTable table, ISagaKeyFormatter <TSaga> keyFormatter)
 {
     Table     = table;
     Formatter = keyFormatter;
 }
Example #8
0
 public AzureTableSagaRepositoryContextFactory(CloudTable cloudTable,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter)
     : this(new ConstCloudTableProvider <TSaga>(cloudTable), factory, keyFormatter)
 {
 }
 public AzureTableSagaRepositoryContextFactory(CloudTable databaseFactory,
                                               ISagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga> factory,
                                               ISagaKeyFormatter <TSaga> keyFormatter) :
     this(() => databaseFactory, factory, keyFormatter)
 {
 }