This commit is contained in:
Фролов 2021-09-10 11:30:10 +05:00
commit c0a4716341

View File

@ -385,23 +385,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)