diff --git a/AsbCloudInfrastructure/Services/DrillParamsService.cs b/AsbCloudInfrastructure/Services/DrillParamsService.cs index 6dfc40f2..bc488e6e 100644 --- a/AsbCloudInfrastructure/Services/DrillParamsService.cs +++ b/AsbCloudInfrastructure/Services/DrillParamsService.cs @@ -104,21 +104,26 @@ namespace AsbCloudInfrastructure.Services public async Task> GetCompositeAllAsync(int idWell, CancellationToken token = default) { - var allDrillParams = await db.WellComposites + var allDrillParamsQuery = db.WellComposites + .Where(c => c.IdWell == idWell) .Join(db.DrillParams, - c => new { IdWell = c.IdWellSrc, IdSection = c.IdWellSectionType }, - p => new { IdWell = p.IdWell, IdSection = p.IdWellSectionType }, - (c, p) => p) + c => c.IdWellSrc, + p => p.IdWell, + (c, p) => p); + + var allDrillParams = await allDrillParamsQuery .AsNoTracking() .ToListAsync(token) .ConfigureAwait(false); - var compositeWellDrillParams = await db.WellComposites + var compositeWellDrillParamsQuery = db.WellComposites .Where(c => c.IdWell == idWell) .Join(db.DrillParams, c => new { IdWell = c.IdWellSrc, IdSection = c.IdWellSectionType }, p => new { IdWell = p.IdWell, IdSection = p.IdWellSectionType }, - (c, p) => p) + (c, p) => p); + + var compositeWellDrillParams = await compositeWellDrillParamsQuery .AsNoTracking() .ToListAsync(token) .ConfigureAwait(false);