From 148abdfb8e16519b2ee8f721ffa1cbb0440f0d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BA=20=D0=98=D0=B3=D0=BE=D1=80=D1=8C?= Date: Fri, 7 Apr 2023 20:52:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82?= =?UTF-8?q?=D1=87=D0=B5=D1=82=D0=B0=20=D0=BF=D0=BE=20=D0=B7=D0=B0=D1=8F?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CarService/CarServiceDatabase/Implements/WorkStorage.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CarService/CarServiceDatabase/Implements/WorkStorage.cs b/CarService/CarServiceDatabase/Implements/WorkStorage.cs index 4dda831..e4cfa28 100644 --- a/CarService/CarServiceDatabase/Implements/WorkStorage.cs +++ b/CarService/CarServiceDatabase/Implements/WorkStorage.cs @@ -59,7 +59,7 @@ namespace CarServiceDatabase.Implements .Select(w => new ReportWorkWithRequestsViewModel() { WorkName = w.Name, - RepairRequests = GetRepairRequestsByWork(model) + RepairRequests = GetRepairRequestsByWork(context, new() { Id = w.Id }) }) .ToList(); } @@ -68,9 +68,8 @@ namespace CarServiceDatabase.Implements /// /// /// - private List GetRepairRequestsByWork(WorkSearchModel model) + private static List GetRepairRequestsByWork(CarServiceDbContext context, WorkSearchModel model) { - using var context = new CarServiceDbContext(); return context.WorksInRequest .Include(wir => wir.RepairRequest) .ThenInclude(rr => rr.Vehicle)