using Hcs.Broker; using Hcs.WebApp.BackgroundServices.ResultGetters.HouseManagement; using Hcs.WebApp.BackgroundServices.ResultGetters.Nsi; using Hcs.WebApp.BackgroundServices.ResultGetters.NsiCommon; using Hcs.WebApp.Data.Hcs; namespace Hcs.WebApp.BackgroundServices.ResultGetters { public class ResultGetterFactory { public IResultGetter CreateResultGetter(IServiceScope scope, IClient client, Operation operation) { return operation.Type switch { Operation.OperationType.Nsi_ExportNsiItem_15_7_0_1 => new ExportDataProviderNsiItemGetter_15_7_0_1(client, scope, operation), Operation.OperationType.NsiCommon_ExportNsiItem_15_7_0_1 => new ExportNsiItemGetter_15_7_0_1(client, scope, operation), Operation.OperationType.HouseManagement_ExportSupplyResourceContractData_15_7_0_1 => new ExportSupplyResourceContractDataGetter_15_7_0_1(client, scope, operation), Operation.OperationType.ParseHousesData_15_7_0_1 => throw new ArgumentException($"Нельзя использовать операцию с типом {operation.Type} для получения результата с ГИС ЖКХ") }; } } }