public async Task <IActionResult> Delete(int id) { if (await _ticketsService.DeleteTicket(id) == 0) { return(NotFound()); } return(Ok()); }
public ActionResult <bool> DeleteTicket(int TicketId) { try { return(Ok(_Ticketservice.DeleteTicket(TicketId))); } catch (NotFoundException ex) { return(NotFound(ex.Message)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, $"Something happend: {ex.Message}")); } }
public async Task <IActionResult> Delete(int id) { return(Ok(await _ticketsService.DeleteTicket(id))); }