示例#1
0
        public IActionResult Post([FromBody] RestaurantCommand restaurant)
        {
            try
            {
                restaurantService.Update(restaurant);
            }
            catch
            {
                return(BadRequest($"Restaurant was not updated"));
            }

            return(Ok("Restaurant was updated succeessfuly"));
        }
示例#2
0
 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
         }
     });
 }
示例#3
0
        public void Update(RestaurantCommand restaurant)
        {
            var _restaurant = BindRestaurant(restaurant);

            repository.Update(_restaurant);
        }