22 lines
915 B
C#
22 lines
915 B
C#
using Hcs.Broker;
|
||
using Hcs.WebApp.BackgroundServices.OperationExecutors.Nsi;
|
||
using Hcs.WebApp.BackgroundServices.OperationExecutors.NsiCommon;
|
||
using Hcs.WebApp.Data.Hcs;
|
||
|
||
namespace Hcs.WebApp.BackgroundServices.OperationExecutors
|
||
{
|
||
public class ExecutorFactory
|
||
{
|
||
public IExecutor CreateExecutor(IServiceScope scope, IClient client, Operation operation)
|
||
{
|
||
return operation.Type switch
|
||
{
|
||
Operation.OperationType.Nsi_ExportNsiItem_15_7_0_1 => new ExportDataProviderNsiItemExecutor_15_7_0_1(client, scope, operation),
|
||
Operation.OperationType.NsiCommon_ExportNsiItem_15_7_0_1 => new ExportNsiItemExecutor_15_7_0_1(client, scope, operation),
|
||
|
||
_ => throw new NotImplementedException($"Не удалось создать выполнителя операции типа {operation.Type}"),
|
||
};
|
||
}
|
||
}
|
||
}
|