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)); }
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); }