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(); Database.OpenConnection();
using var reader = await command.ExecuteReaderAsync(token); 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 (rd.HasRows) if (reader.HasRows)
{ {
while (reader.Read()) while (reader.Read())
{ {
yield return result.Add(
( (
(double?)reader.GetValue(0), (double?)reader.GetValue(0),
(double?)reader.GetValue(1), (double?)reader.GetValue(1),
(DateTime)reader.GetValue(2) (DateTime)reader.GetValue(2)
); ));
}
} }
} }
return GetResult(reader); return result;
} }
public async Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default) public async Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default)