public static ISagaRepository <TSaga> Create(string connectionString, IsolationLevel isolationLevel = IsolationLevel.Serializable)
        {
            var consumeContextFactory = new SagaConsumeContextFactory <DatabaseContext <TSaga>, TSaga>();

            var options = new DapperOptions <TSaga>(connectionString, isolationLevel);
            var repositoryContextFactory = new DapperSagaRepositoryContextFactory <TSaga>(options, consumeContextFactory);

            return(new SagaRepository <TSaga>(repositoryContextFactory));
        }
예제 #2
0
        public DapperSagaRepository(string connectionString, IsolationLevel isolationLevel = IsolationLevel.Serializable)
        {
            var consumeContextFactory = new DapperSagaConsumeContextFactory <TSaga>();

            var options = new DapperOptions <TSaga>(connectionString, isolationLevel);
            var repositoryContextFactory = new DapperSagaRepositoryContextFactory <TSaga>(options, consumeContextFactory);

            _repository = new SagaRepository <TSaga>(repositoryContextFactory);
        }