Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 public Restauran save(Restauran newRestaurant)
 {
     restaurant.Add(newRestaurant);
     newRestaurant.id = restaurant.Max(c => c.id) + 1;
     return(newRestaurant);
 }