/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Persistence/MassTransit.Azure.Table/Configuration/AzureTableJobServiceConfigurationExtensions.cs
33 строки
1 KB
Michelle Li
upgrade from Microsoft.Azure.Cosmos.Table to Azure.Data.Tables
03 ноя 2024, 21:05
03 ноя 2024, 21:05
affb5f9
Код
Авторство
О чём код?
namespace MassTransit { using System; using Azure.Data.Tables; using AzureTable; using AzureTable.Saga; public static class AzureTableJobServiceConfigurationExtensions { public static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator, Func<TableClient> 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 static void UseAzureTableSagaRepository(this IJobServiceConfigurator configurator, Func<TableClient> contextFactory) { UseAzureTableSagaRepository(configurator, contextFactory, new ConstPartitionSagaKeyFormatter<JobTypeSaga>(nameof(JobTypeSaga)), new ConstPartitionSagaKeyFormatter<JobSaga>(nameof(JobSaga)), new ConstPartitionSagaKeyFormatter<JobAttemptSaga>(nameof(JobAttemptSaga))); } } }