fix
This commit is contained in:
parent
da162462b5
commit
5dbea38023
@ -24,10 +24,8 @@ namespace FoodOrdersBusinessLogic.BusinessLogics
|
||||
|
||||
public List<DishViewModel>? 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");
|
||||
|
@ -22,8 +22,7 @@ namespace FoodOrdersListImplement.Implements
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<DishViewModel> GetFilteredList(DishSearchModel
|
||||
model)
|
||||
public List<DishViewModel> GetFilteredList(DishSearchModel model)
|
||||
{
|
||||
var result = new List<DishViewModel>();
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user