CS2-1: Убран лишний параметр из метода GetDatesRange()

This commit is contained in:
KharchenkoVV 2021-05-17 14:04:33 +05:00
parent abbc461330
commit 583866d75d
4 changed files with 7 additions and 4 deletions

View File

@ -195,8 +195,11 @@ namespace AsbCloudDb.Model
.Include(e => e.Customer) .Include(e => e.Customer)
.Where(e => e.Login == login); .Where(e => e.Login == login);
public (DateTime From, DateTime To) GetDatesRange<T>(DbSet<T> dbSet, int idTelemetry) where T : class, IIdTelemetryDate public (DateTime From, DateTime To) GetDatesRange<TEntity>(int idTelemetry)
where TEntity : class, IIdTelemetryDate
{ {
var dbSet = Set<TEntity>();
var datesRange = (from m in dbSet var datesRange = (from m in dbSet
where m.IdTelemetry == idTelemetry where m.IdTelemetry == idTelemetry
group m by m.IdTelemetry into g group m by m.IdTelemetry into g

View File

@ -26,7 +26,7 @@ namespace AsbCloudDb.Model
IQueryable<Well> GetWellsByCustomer(int idCustomer); IQueryable<Well> GetWellsByCustomer(int idCustomer);
IQueryable<User> GetUsersByLogin(string login); IQueryable<User> GetUsersByLogin(string login);
(DateTime From, DateTime To) GetDatesRange<T>(DbSet<T> dbSet, int idTelemetry) where T : class, IIdTelemetryDate; (DateTime From, DateTime To) GetDatesRange<T>(int idTelemetry) where T : class, IIdTelemetryDate;
Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default) where TEntity : class; Task<int> CreatePartitionAsync<TEntity>(string propertyName, int id, CancellationToken token = default) where TEntity : class;
} }
} }

View File

@ -102,7 +102,7 @@ namespace AsbCloudInfrastructure.Services
if (telemetry is null) if (telemetry is null)
return null; return null;
var result = db.GetDatesRange<DataSaubBase>(db.DataSaubBases, telemetry.Id); var result = db.GetDatesRange<DataSaubBase>(telemetry.Id);
return new DatesRangeDto { From = result.From, To = result.To}; return new DatesRangeDto { From = result.From, To = result.To};
} }

View File

@ -108,7 +108,7 @@ namespace AsbCloudInfrastructure.Services
if (telemetry is null) if (telemetry is null)
return null; return null;
var result = db.GetDatesRange<Message>(db.Messages, telemetry.Id); var result = db.GetDatesRange<Message>(telemetry.Id);
return new DatesRangeDto { From = result.From, To = result.To }; return new DatesRangeDto { From = result.From, To = result.To };
} }