diff --git a/FoodOrders/FoodOrdersListImplement/DataListSingleton.cs b/FoodOrders/FoodOrdersListImplement/DataListSingleton.cs index d8e4c35..87ce9fe 100644 --- a/FoodOrders/FoodOrdersListImplement/DataListSingleton.cs +++ b/FoodOrders/FoodOrdersListImplement/DataListSingleton.cs @@ -7,12 +7,12 @@ namespace FoodOrdersListImplement private static DataListSingleton? _instance; public List Components { get; set; } public List Orders { get; set; } - public List Dish { get; set; } + public List Dishes { get; set; } private DataListSingleton() { Components = new List(); Orders = new List(); - Dish = new List(); + Dishes = new List(); } public static DataListSingleton GetInstance() { diff --git a/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs b/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs index 7b50795..1956a9d 100644 --- a/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs +++ b/FoodOrders/FoodOrdersListImplement/Implements/DishStorage.cs @@ -16,7 +16,7 @@ namespace FoodOrdersListImplement.Implements public List GetFullList() { var result = new List(); - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { result.Add(dish.GetViewModel); } @@ -29,7 +29,7 @@ namespace FoodOrdersListImplement.Implements { return result; } - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { if (dish.DishName.Contains(model.DishName)) { @@ -44,7 +44,7 @@ namespace FoodOrdersListImplement.Implements { return null; } - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { if ((!string.IsNullOrEmpty(model.DishName) && dish.DishName == model.DishName) || (model.Id.HasValue && dish.Id == model.Id)) { @@ -56,7 +56,7 @@ namespace FoodOrdersListImplement.Implements public DishViewModel? Insert(DishBindingModel model) { model.Id = 1; - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { if (model.Id <= dish.Id) { @@ -68,12 +68,12 @@ namespace FoodOrdersListImplement.Implements { return null; } - _source.Dish.Add(newDish); + _source.Dishes.Add(newDish); return newDish.GetViewModel; } public DishViewModel? Update(DishBindingModel model) { - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { if (dish.Id == model.Id) { @@ -85,12 +85,12 @@ namespace FoodOrdersListImplement.Implements } public DishViewModel? Delete(DishBindingModel model) { - for (int i = 0; i < _source.Dish.Count; ++i) + for (int i = 0; i < _source.Dishes.Count; ++i) { - if (_source.Dish[i].Id == model.Id) + if (_source.Dishes[i].Id == model.Id) { - var element = _source.Dish[i]; - _source.Dish.RemoveAt(i); + var element = _source.Dishes[i]; + _source.Dishes.RemoveAt(i); return element.GetViewModel; } } diff --git a/FoodOrders/FoodOrdersListImplement/Implements/OrderStorage.cs b/FoodOrders/FoodOrdersListImplement/Implements/OrderStorage.cs index c9b2696..03d7b1b 100644 --- a/FoodOrders/FoodOrdersListImplement/Implements/OrderStorage.cs +++ b/FoodOrders/FoodOrdersListImplement/Implements/OrderStorage.cs @@ -63,7 +63,7 @@ namespace FoodOrdersListImplement.Implements private OrderViewModel GetViewModel(Order order) { var viewModel = order.GetViewModel; - foreach (var dish in _source.Dish) + foreach (var dish in _source.Dishes) { if (dish.Id == order.DishId) {