/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Persistence/MassTransit.EntityFrameworkIntegration/EntityFrameworkIntegration/ISagaDbContextFactory.cs
33 строки
964 B
Chris Patterson
Integration of all external packages into MassTransit, split out into Abstractions, Middleware, and the core MassTransit assembly.
22 янв 2022, 18:24
22 янв 2022, 18:24
b5b4f50
Код
Авторство
О чём код?
namespace MassTransit.EntityFrameworkIntegration { using System.Data.Entity; /// <summary> /// Creates a DbContext for the saga repository /// </summary> public interface ISagaDbContextFactory<out TSaga> where TSaga : class, ISaga { /// <summary> /// Create a standalone DbContext /// </summary> /// <returns></returns> DbContext Create(); /// <summary> /// Create a scoped DbContext within the lifetime scope of the saga repository /// </summary> /// <param name="context"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> DbContext CreateScoped<T>(ConsumeContext<T> context) where T : class; /// <summary> /// Release the DbContext once it is no longer needed /// </summary> /// <param name="dbContext"></param> void Release(DbContext dbContext); } }