public Restauran update(Restauran rest) { var restaurante = restaurant.FirstOrDefault(c => c.id == rest.id); if (restaurante != null) { restaurante.name = rest.name; restaurante.locationn = rest.locationn; restaurante.type = rest.type; } return(restaurante); }
public IActionResult OnGet(int restaurantId) { if (restaurantId > 0) { restaurant = iFoodData.getById(restaurantId); cusines = html.GetEnumSelectList <typeCusinet>(); if (restaurant == null) { return(RedirectToPage("./notFound")); } } else { restaurant = new Restauran(); } return(Page()); }
public Restauran save(Restauran newRestaurant) { restaurant.Add(newRestaurant); newRestaurant.id = restaurant.Max(c => c.id) + 1; return(newRestaurant); }