Files
hcs/Hcs.WebApp/BackgroundServices/DataParsers/DataParserFactory.cs

20 lines
877 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Hcs.WebApp.Data.Hcs;
namespace Hcs.WebApp.BackgroundServices.DataParsers
{
public class DataParserFactory
{
public IDataParser CreateDataParser(IServiceScope scope, Operation operation, IWebHostEnvironment webHostEnvironment)
{
return operation.Type switch
{
Operation.OperationType.ParseHousesData_15_7_0_1 => new HousesDataParser_15_7_0_1(scope, operation, webHostEnvironment),
Operation.OperationType.NsiCommon_ExportNsiItem_15_7_0_1 or
Operation.OperationType.Nsi_ExportNsiItem_15_7_0_1 or
Operation.OperationType.HouseManagement_ExportSupplyResourceContractData_15_7_0_1 => throw new ArgumentException($"Нельзя использовать операцию с типом {operation.Type} для парсинга")
};
}
}
}