forked from ddrilling/AsbCloudServer
7051313 nit
This commit is contained in:
parent
51d4e30100
commit
cc25e11c40
@ -20,6 +20,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<IEnumerable<WellCompositeDto>> GetAsync(int idWell, CancellationToken token)
|
||||
{
|
||||
var entities = await db.WellComposites
|
||||
@ -30,6 +31,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
return entities.Select(Convert);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Task<int> SaveAsync(int idWell, IEnumerable<WellCompositeDto> wellComposites, CancellationToken token)
|
||||
{
|
||||
db.WellComposites.RemoveRange(db.WellComposites
|
||||
@ -42,13 +44,13 @@ namespace AsbCloudInfrastructure.Repository
|
||||
return db.SaveChangesAsync(token);
|
||||
}
|
||||
|
||||
private WellComposite Convert(int idWell, WellCompositeDto dto)
|
||||
private static WellComposite Convert(int idWell, WellCompositeDto dto)
|
||||
{
|
||||
var entity = dto.Adapt<WellComposite>();
|
||||
entity.IdWell = idWell;
|
||||
return entity;
|
||||
}
|
||||
private WellCompositeDto Convert(WellComposite entity)
|
||||
private static WellCompositeDto Convert(WellComposite entity)
|
||||
{
|
||||
var dto = entity.Adapt<WellCompositeDto>();
|
||||
return dto;
|
||||
|
Loading…
Reference in New Issue
Block a user