Refactor code to .NET8
This commit is contained in:
@@ -27,7 +27,7 @@ public class T3MultiSourceSummaryProcessor
|
||||
var year = int.Parse(processWorker.Records?.SingleOrDefault(x => x.Code == "Year")?.Desc1!);
|
||||
var month = int.Parse(processWorker.Records?.SingleOrDefault(x => x.Code == "Month")?.Desc1!);
|
||||
var sources = processWorker.Records?.Where(x => x.Code == "Source").ToList();
|
||||
if (!sources!.Any())
|
||||
if (sources!.Count == 0)
|
||||
{
|
||||
throw new Exception("Source record not found");
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class T3MultiSourceSummaryProcessor
|
||||
|
||||
var newRecords = new List<Record>();
|
||||
|
||||
var dataSources = sources!.Select(source => _db.Layers.Where(x => x.Type == LayerType.Processed && !x.IsDeleted && x.Name != null && x.Name.Contains($"{year}/{month}-{source.Desc1}-T3"))
|
||||
var dataSources = sources.Select(source => _db.Layers.Where(x => x.Type == LayerType.Processed && !x.IsDeleted && x.Name != null && x.Name.Contains($"{year}/{month}-{source.Desc1}-T3"))
|
||||
.Include(x => x.Records)
|
||||
.FirstOrDefault())
|
||||
.OfType<Layer>()
|
||||
@@ -98,7 +98,7 @@ public class T3MultiSourceSummaryProcessor
|
||||
|
||||
// Dynamic Codes
|
||||
var dynamicCodes = processWorker.Records?.Where(x => x.Code == "DynamicCode").ToList();
|
||||
if (dynamicCodes != null && dynamicCodes.Any())
|
||||
if (dynamicCodes != null && dynamicCodes.Count != 0)
|
||||
{
|
||||
foreach (var dynamicCode in dynamicCodes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user