From 9bf936c7174b696c13f2f81da78d3407113fe28b 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: Sat, 8 Apr 2023 19:35:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D1=80=D0=B0=D1=81=D1=87?= =?UTF-8?q?=D0=B5=D1=82=D0=B0=20=D1=81=D1=82=D0=BE=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=B2=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CarService/CarServiceDatabase/Models/WorkInRequest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarService/CarServiceDatabase/Models/WorkInRequest.cs b/CarService/CarServiceDatabase/Models/WorkInRequest.cs index f484371..6cb636d 100644 --- a/CarService/CarServiceDatabase/Models/WorkInRequest.cs +++ b/CarService/CarServiceDatabase/Models/WorkInRequest.cs @@ -33,7 +33,7 @@ namespace CarServiceDatabase.Models return new() { Count = model.Count, - Cost = model.Cost, + Cost = context.Works.First(x => x.Id == model.WorkId).Price * model.Count, RepairRequestId = model.RepairRequestId, Work = context.Works.First(x => x.Id == model.WorkId) }; @@ -45,7 +45,7 @@ namespace CarServiceDatabase.Models return; } Count = model.Count; - Cost = model.Cost; + Cost = context.Works.First(x => x.Id == model.WorkId).Price * model.Count; RepairRequestId = model.RepairRequestId; Work = context.Works.First(x => x.Id == model.WorkId); }