/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Persistence/MassTransit.DapperIntegration/DapperSagaRepository.cs
21 строка
805 B
Chris Patterson
Added ability to extend the DatabaseContext<T> provider for the Dapper saga repository to replace the implementation
10 сен 2024, 17:09
10 сен 2024, 17:09
a956dd6
Код
Авторство
О чём код?
namespace MassTransit { using System.Data; using DapperIntegration.Saga; using Saga; public static class DapperSagaRepository<TSaga> where TSaga : class, ISaga { 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, null); var repositoryContextFactory = new DapperSagaRepositoryContextFactory<TSaga>(options, consumeContextFactory); return new SagaRepository<TSaga>(repositoryContextFactory, repositoryContextFactory, repositoryContextFactory); } } }