DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanParser.cs

30 lines
889 B
C#

using System.Collections.Generic;
using System.IO;
using AsbCloudApp.Data;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudApp.Requests.ParserOptions;
using AsbCloudInfrastructure.Services.ExcelServices;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
public abstract class ProcessMapPlanParser<TDto> : ParserExcelService<TDto, WellRelatedParserRequest>
where TDto : ProcessMapPlanBaseDto
{
protected readonly IEnumerable<WellSectionTypeDto> sections;
protected ProcessMapPlanParser(IWellOperationRepository wellOperationRepository)
{
sections = wellOperationRepository.GetSectionTypes();
}
public override ParserResultDto<TDto> Parse(Stream file, WellRelatedParserRequest options)
{
var result = base.Parse(file, options);
foreach (var item in result.Item)
item.Item.IdWell = options.IdWell;
return result;
}
}