From 5dbea38023b34d56a0f267ae14caa5275ac32c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Sat, 11 Mar 2023 19:28:29 +0400 Subject: [PATCH] fix --- .../FoodOrdersBusinessLogic/BusinessLogics/DishLogic.cs | 6 ++---- .../FoodOrdersListImplement/Implements/DishStorage.cs | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/DishLogic.cs b/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/DishLogic.cs index f42394d..78cc2b7 100644 --- a/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/DishLogic.cs +++ b/FoodOrders/FoodOrdersBusinessLogic/BusinessLogics/DishLogic.cs @@ -24,10 +24,8 @@ namespace FoodOrdersBusinessLogic.BusinessLogics public List? ReadList(DishSearchModel? model) { - _logger.LogInformation("ReadList. DishName:{DishName}. Id:{Id}", - model?.DishName, model?.Id); - var list = model == null ? _dishStorage.GetFullList() : - _dishStorage.GetFilteredList(model); + _logger.LogInformation("ReadList. DishName:{DishName}. Id:{Id}", model?.DishName, model?.Id); + var list = model == null ? _dishStorage.GetFullList() : _dishStorage.GetFilteredList(model); if (list == null) { _logger.LogWarning("ReadList return null list"); diff --git a/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs b/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs index c751142..7b50795 100644 --- a/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs +++ b/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs @@ -22,8 +22,7 @@ namespace FoodOrdersListImplement.Implements } return result; } - public List GetFilteredList(DishSearchModel - model) + public List GetFilteredList(DishSearchModel model) { var result = new List(); if (string.IsNullOrEmpty(model.DishName)) @@ -47,9 +46,7 @@ namespace FoodOrdersListImplement.Implements } foreach (var dish in _source.Dish) { - if ((!string.IsNullOrEmpty(model.DishName) && - dish.DishName == model.DishName) || - (model.Id.HasValue && dish.Id == model.Id)) + if ((!string.IsNullOrEmpty(model.DishName) && dish.DishName == model.DishName) || (model.Id.HasValue && dish.Id == model.Id)) { return dish.GetViewModel; }