Fixed return of .DepthToInterval() analytics method

This commit is contained in:
KharchenkoVV 2021-09-09 12:55:13 +05:00
parent 3c9718b0de
commit b022a4c1cb

View File

@ -378,23 +378,22 @@ namespace AsbCloudDb.Model
Database.OpenConnection();
using var reader = await command.ExecuteReaderAsync(token);
IEnumerable<(double? MinDepth, double? MaxDepth, DateTime BeginPeriodDate)> GetResult(DbDataReader rd)
var result = new List<(double? MinDepth, double? MaxDepth, DateTime BeginPeriodDate)>();
if (reader.HasRows)
{
if (rd.HasRows)
while (reader.Read())
{
while (reader.Read())
{
yield return
(
(double?)reader.GetValue(0),
(double?)reader.GetValue(1),
(DateTime)reader.GetValue(2)
);
}
result.Add(
(
(double?)reader.GetValue(0),
(double?)reader.GetValue(1),
(DateTime)reader.GetValue(2)
));
}
}
return GetResult(reader);
return result;
}
public async Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default)