public Dish(int id, string name, decimal weight, decimal price, Layots layot, RecipeDish recipe, string kitchen) { Name = name; Weight = weight; Price = price; LayoutDish = layot; RecipeDish = recipe; Kitchen = kitchen; }
public Dish(DishEnt dish) { Id = dish.Id; Name = dish.Name; Weight = dish.Weight; Price = dish.Price; LayoutDish = new Layots(dish.LayoutDish); RecipeDish = new RecipeDish(dish.RecipeDish); Kitchen = dish.Kitchen; }
List <RecipeDish> DishesOutpoot() { List <RecipeDishEnt> recipeDishEnts = Unit.RecipesRepository.AllItems.ToList(); List <RecipeDish> recipeDishes = new List <RecipeDish>(); foreach (var p in recipeDishEnts) { Dish dish = new Dish(p.Dish.Id, p.Dish.Name, p.Dish.Weight, p.Dish.Price, new Layots(p.Dish.LayoutDish), new RecipeDish(p.Dish.RecipeDish), p.Dish.Kitchen); RecipeDish recipe = new RecipeDish(p.Id, p.Recipe, new Dish(p.Dish)); recipeDishes.Add(recipe); } return(recipeDishes); }