Processing fixes
This commit is contained in:
@@ -89,16 +89,18 @@ namespace WebAPI.dataProcessors
|
||||
}
|
||||
|
||||
List<Record> allRecords = dataSources.SelectMany(x => x.Records!).ToList();
|
||||
foreach (Record baseRecord in dataSources.Last()?.Records!)
|
||||
List<string> baseCodess = allRecords.Select(x => x.Code!.Remove(0, 1)).Distinct().ToList();
|
||||
|
||||
foreach (string baseCode in baseCodess)
|
||||
{
|
||||
|
||||
List<Record> codeRecords = allRecords.Where(x =>
|
||||
x.Code!.Substring(1) == baseRecord.Code!.Substring(1))
|
||||
x.Code!.Substring(1) == baseCode)
|
||||
.ToList();
|
||||
Record processedRecord = new Record
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Code = $"9{baseRecord.Code!.Remove(0,1)}",
|
||||
Code = $"9{baseCode}",
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
ModifiedAt = DateTime.UtcNow
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user