public void Update(Guid id, RestaurantUpdateModel r) { Restaurant restaurant = GetById(id); restaurant.Name = r.Name; restaurant.PhoneNumber = r.PhoneNumber; restaurant.Type = r.Type; restaurant.Website = r.Website; restaurant.OpeningClosingTime = r.OpeningClosingTime; restaurant.Address = r.Address; restaurant.Rating = r.Rating; _restaurantRepository.Update(restaurant); _restaurantRepository.Save(); }
public IActionResult Update(Guid id, [FromBody] RestaurantUpdateModel restaurant) { _restaurantLogic.Update(id, restaurant); return(Ok()); }
public async Task <IActionResult> Put([FromBody] RestaurantUpdateModel data) { await _restaurantData.UpdateRestaurant(data.Id, data.RestName, data.City, data.RestDescription); return(Ok()); }