From 9ba9cf92d134e39e4639711618b1d751b0ea4dc6 Mon Sep 17 00:00:00 2001 From: "ityurner02@mail.ru" Date: Sun, 16 Apr 2023 22:17:26 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=81=D0=B5=20=D0=B5=D1=89=D0=B5=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj | 7 +++++++ PlumbingRepair/PlumbingRepair/Program.cs | 2 +- .../Implements/OrderStorage.cs | 7 ++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj b/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj index 4b959e7..e1d3bc5 100644 --- a/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj +++ b/PlumbingRepair/PlumbingRepair/PlumbingRepair.csproj @@ -13,6 +13,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -26,4 +27,10 @@ + + + Always + + + \ No newline at end of file diff --git a/PlumbingRepair/PlumbingRepair/Program.cs b/PlumbingRepair/PlumbingRepair/Program.cs index 5563f71..5fa1c75 100644 --- a/PlumbingRepair/PlumbingRepair/Program.cs +++ b/PlumbingRepair/PlumbingRepair/Program.cs @@ -45,8 +45,8 @@ namespace PlumbingRepair services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/PlumbingRepair/PlumbingRepairDatabaseImplement/Implements/OrderStorage.cs b/PlumbingRepair/PlumbingRepairDatabaseImplement/Implements/OrderStorage.cs index 0241b26..9842a92 100644 --- a/PlumbingRepair/PlumbingRepairDatabaseImplement/Implements/OrderStorage.cs +++ b/PlumbingRepair/PlumbingRepairDatabaseImplement/Implements/OrderStorage.cs @@ -81,9 +81,10 @@ namespace PlumbingRepairDatabaseImplement.Implements .Include(x => x.Work) .Include(x => x.Client) .Include(x => x.Implementer) - .FirstOrDefault(x => model.Id.HasValue && x.Id == model.Id) - ?.GetViewModel; - } + .FirstOrDefault(x => (!model.ImplementerId.HasValue || x.ImplementerId == model.ImplementerId) && + (!model.Status.HasValue || x.Status == model.Status) && + (!model.Id.HasValue || x.Id == model.Id))?.GetViewModel; + } public OrderViewModel? Insert(OrderBindingModel model) {