forked from ddrilling/AsbCloudServer
CS2-50: Changed some .SaveChanges() to .SaveChangesAsync()
This commit is contained in:
parent
c7b87a1104
commit
fe5eb39000
@ -12,7 +12,7 @@ namespace AsbCloudApp.Services
|
||||
double intervalSec = 600d, int approxPointsCount = 1024,
|
||||
CancellationToken token = default);
|
||||
|
||||
Task UpdateDataAsync(string uid, IEnumerable<DataSaubBaseDto> dtos,
|
||||
Task<int> UpdateDataAsync(string uid, IEnumerable<DataSaubBaseDto> dtos,
|
||||
CancellationToken token);
|
||||
Task<DatesRangeDto> GetDataDatesRangeAsync(int idWell,
|
||||
CancellationToken token);
|
||||
|
@ -7,7 +7,7 @@ namespace AsbCloudApp.Services
|
||||
{
|
||||
Task<Tdto> GetAsync(int idWell, int idCategory,
|
||||
CancellationToken token);
|
||||
Task UpsertAsync(int idWell, int idCategory, Tdto value,
|
||||
Task<int> UpsertAsync(int idWell, int idCategory, Tdto value,
|
||||
CancellationToken token);
|
||||
}
|
||||
}
|
||||
|
@ -73,11 +73,11 @@ namespace AsbCloudInfrastructure.Services
|
||||
return dtos;
|
||||
}
|
||||
|
||||
public async Task UpdateDataAsync(string uid, IEnumerable<DataSaubBaseDto> dtos,
|
||||
public async Task<int> UpdateDataAsync(string uid, IEnumerable<DataSaubBaseDto> dtos,
|
||||
CancellationToken token = default)
|
||||
{
|
||||
if (dtos == default || !dtos.Any())
|
||||
return;
|
||||
return 0;
|
||||
|
||||
var telemetryId = telemetryService.GetOrCreateTemetryIdByUid(uid);
|
||||
var dtoMinDate = dtos.Min(d => d.Date);
|
||||
@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
analyticsService.SaveAnalytics(dto);
|
||||
}
|
||||
|
||||
db.SaveChanges();
|
||||
return await db.SaveChangesAsync(token);
|
||||
}
|
||||
|
||||
public async Task<DatesRangeDto> GetDataDatesRangeAsync(int idWell,
|
||||
|
@ -31,7 +31,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
return dto;
|
||||
}
|
||||
|
||||
public async Task UpsertAsync(int idWell, int idCategory,
|
||||
public async Task<int> UpsertAsync(int idWell, int idCategory,
|
||||
Tdto value, CancellationToken token = default)
|
||||
{
|
||||
var model = value.Adapt<TModel>();
|
||||
@ -57,7 +57,7 @@ namespace AsbCloudInfrastructure.Services
|
||||
db.LastData.Add(newLastData);
|
||||
}
|
||||
|
||||
db.SaveChanges();
|
||||
return await db.SaveChangesAsync(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user