Пример #1
0
        public IHttpActionResult Delete(int id)
        {
            bool isDeleted = businessService.DeleteBusiness(id);

            if (isDeleted == true)
            {
                return(Ok());
            }
            return(BadRequest());
        }
 public async Task <ActionResult <DeleteModel> > DeleteMovie(int businessId)
 {
     try
     {
         return(Ok(await businessService.DeleteBusiness(businessId)));
     }
     catch (RequestNotFoundException ex)
     {
         return(NotFound(ex.Message));
     }
     catch (InternalServerException ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
Пример #3
0
 public async Task <RedirectToActionResult> Delete(int id)
 {
     businessService.DeleteBusiness(id);
     return(RedirectToAction("Index"));
 }