fix helper class

This commit is contained in:
Фролов 2021-08-25 11:41:09 +05:00
parent 85ff9a5903
commit 590197d3a6
2 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ namespace AsbCloudInfrastructure
var max = items[0];
for (var i = 1; i < count; i++)
if (max.CompareTo(items[i]) > 0)
if (max.CompareTo(items[i]) < 0)
max = items[i];
return max;
@ -28,7 +28,7 @@ namespace AsbCloudInfrastructure
var min = items[0];
for (var i = 1; i < count; i++)
if (min.CompareTo(items[i]) < 0)
if (min.CompareTo(items[i]) > 0)
min = items[i];
return min;
@ -44,9 +44,9 @@ namespace AsbCloudInfrastructure
var min = items[0];
var max = items[0];
for (var i = 1; i < count; i++)
if (max.CompareTo(items[i]) > 0)
if (max.CompareTo(items[i]) < 0)
max = items[i];
else if (min.CompareTo(items[i]) < 0)
else if (min.CompareTo(items[i]) > 0)
min = items[i];
return (min, max);

View File

@ -246,6 +246,7 @@ namespace AsbCloudInfrastructure.Services
private static IEnumerable<OperationParams> MakeOperationsExt(IEnumerable<WellOperation> operations)
{
var sortedOperations = operations.OrderBy(o => o.StartDate);
var count = operations.Count();
var ops = new List<OperationParams>(count);
var item = operations.ElementAt(0);