public List <DishLocal> GetMenuLocalEdit(int?idLocal) { var dishes = (from loc in db.DishesPerLocal where loc.IdLocal == idLocal select loc); List <DishLocal> result = new List <DishLocal>(); foreach (DishesPerLocal tmpDish in dishes) { DishLocal tmpDishesPerLocal = new DishLocal(); tmpDishesPerLocal.dish = tmpDish.Dish; tmpDishesPerLocal.idDish = tmpDish.IdDish; tmpDishesPerLocal.state = tmpDish.State; result.Add(tmpDishesPerLocal); } return(result); }
public List <DishLocal> GetMenuLocal(int?idRestaurant) { var dishes = (from loc in db.Dish where loc.IdRestaurant == idRestaurant select loc); List <DishLocal> result = new List <DishLocal>(); foreach (Dish tmpDish in dishes) { DishLocal tmpDishesPerLocal = new DishLocal(); tmpDishesPerLocal.dish = tmpDish; tmpDishesPerLocal.idDish = tmpDish.IdDish; tmpDishesPerLocal.state = true; result.Add(tmpDishesPerLocal); } return(result); }