From cd21f23715db9204349fa580ea12d47b666e674d Mon Sep 17 00:00:00 2001 From: dasha Date: Thu, 18 May 2023 19:39:29 +0400 Subject: [PATCH] commit --- .../HardwareShopContracts/SearchModels/BuildSearchModel.cs | 2 -- .../Implements/Worker/BuildStorage.cs | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/HardwareShop/HardwareShopContracts/SearchModels/BuildSearchModel.cs b/HardwareShop/HardwareShopContracts/SearchModels/BuildSearchModel.cs index 6999a46..e42cdaf 100644 --- a/HardwareShop/HardwareShopContracts/SearchModels/BuildSearchModel.cs +++ b/HardwareShop/HardwareShopContracts/SearchModels/BuildSearchModel.cs @@ -4,8 +4,6 @@ { public int? Id { get; set; } - public int? PurchaseId { get; set; } - public string? BuildName { get; set; } = string.Empty; public int? UserId { get; set; } diff --git a/HardwareShop/HardwareShopDatabaseImplement/Implements/Worker/BuildStorage.cs b/HardwareShop/HardwareShopDatabaseImplement/Implements/Worker/BuildStorage.cs index c1f9e7f..cfe1fbb 100644 --- a/HardwareShop/HardwareShopDatabaseImplement/Implements/Worker/BuildStorage.cs +++ b/HardwareShop/HardwareShopDatabaseImplement/Implements/Worker/BuildStorage.cs @@ -53,14 +53,13 @@ namespace HardwareShopDatabaseImplement.Implements.Worker return null; } using var context = new HardwareShopDatabase(); - var dadada = context.Builds + var result = context.Builds .Include(x => x.Purchases) .ThenInclude(x => x.Purchase) .FirstOrDefault(x => (!string.IsNullOrEmpty(model.BuildName) && x.BuildName == model.BuildName) || (model.Id.HasValue && x.Id == model.Id)) ?.GetViewModel; - return dadada; - + return result; } public BuildViewModel? Insert(BuildBindingModel model)