コード例 #1
0
        public ActionResult Delete(int id)
        {
            var result = new ResultApi <RestaurantListViewModel>();

            try
            {
                var restaurant = _restaurantAppService.GetById(id);

                _restaurantAppService.Remove(restaurant);
            }
            catch (Exception e)
            {
                result.Sucesso  = false;
                result.Mensagem = e.Message;
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public IActionResult Delete(Guid id)
        {
            _restaurantAppService.Remove(id);

            return(Response());
        }
コード例 #3
0
 public void Delete(Guid id)
 {
     _restaurantAppService.Remove(id);
 }
コード例 #4
0
        public Task <HttpResponseMessage> Remove(int restaurantId)
        {
            var restaurant = _service.Remove(restaurantId);

            return(CreateResponse(HttpStatusCode.Created, restaurant));
        }