#5996638 исправление запроса параметров бурения для всех секций композитной скважины

This commit is contained in:
ngfrolov 2022-09-20 12:29:55 +05:00
parent 07eb1bd878
commit ed5f181754

View File

@ -104,21 +104,26 @@ namespace AsbCloudInfrastructure.Services
public async Task<IEnumerable<DrillParamsDto>> GetCompositeAllAsync(int idWell, public async Task<IEnumerable<DrillParamsDto>> GetCompositeAllAsync(int idWell,
CancellationToken token = default) CancellationToken token = default)
{ {
var allDrillParams = await db.WellComposites var allDrillParamsQuery = db.WellComposites
.Where(c => c.IdWell == idWell)
.Join(db.DrillParams, .Join(db.DrillParams,
c => new { IdWell = c.IdWellSrc, IdSection = c.IdWellSectionType }, c => c.IdWellSrc,
p => new { IdWell = p.IdWell, IdSection = p.IdWellSectionType }, p => p.IdWell,
(c, p) => p) (c, p) => p);
var allDrillParams = await allDrillParamsQuery
.AsNoTracking() .AsNoTracking()
.ToListAsync(token) .ToListAsync(token)
.ConfigureAwait(false); .ConfigureAwait(false);
var compositeWellDrillParams = await db.WellComposites var compositeWellDrillParamsQuery = db.WellComposites
.Where(c => c.IdWell == idWell) .Where(c => c.IdWell == idWell)
.Join(db.DrillParams, .Join(db.DrillParams,
c => new { IdWell = c.IdWellSrc, IdSection = c.IdWellSectionType }, c => new { IdWell = c.IdWellSrc, IdSection = c.IdWellSectionType },
p => new { IdWell = p.IdWell, IdSection = p.IdWellSectionType }, p => new { IdWell = p.IdWell, IdSection = p.IdWellSectionType },
(c, p) => p) (c, p) => p);
var compositeWellDrillParams = await compositeWellDrillParamsQuery
.AsNoTracking() .AsNoTracking()
.ToListAsync(token) .ToListAsync(token)
.ConfigureAwait(false); .ConfigureAwait(false);