public IActionResult Post([FromBody] RestaurantCommand restaurant) { try { restaurantService.Update(restaurant); } catch { return(BadRequest($"Restaurant was not updated")); } return(Ok("Restaurant was updated succeessfuly")); }
private Restaurant BindRestaurant(RestaurantCommand restaurant) { return(new Restaurant { RestaurantId = restaurant.RestaurantId, Address = restaurant.Address, Name = restaurant.Name, Photo = restaurant.Photo, Coordinate = new Coordinate { Latitude = restaurant.Latitude, Longitude = restaurant.Longitude } }); }
public void Update(RestaurantCommand restaurant) { var _restaurant = BindRestaurant(restaurant); repository.Update(_restaurant); }