Ejemplo n.º 1
0
 public ActionResult <bool> DeleteWorkshopById([FromRoute] int workshopId)
 {
     try
     {
         return(Ok(_service.DeleteWorkshop(workshopId)));
     }
     catch (NotFoundItemException ex)
     {
         return(StatusCode(StatusCodes.Status404NotFound, $"Something bad happened: {ex.Message}"));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, $"Something bad happened: {ex.Message}"));
     }
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteWorkshop(long id)
        {
            await _workshopService.DeleteWorkshop(id);

            return(NoContent());
        }