public HttpResponseMessage Delete(int id) { SucessResponse response = new Sabio.Web.Models.Responses.SucessResponse(); _meetingsService.Delete(id); return(Request.CreateResponse(response)); }
public async Task <ActionResult <Meeting> > Delete(int id) { try { var existing = await meetingService.GetAsync(id); if (existing == null) { return(NotFound()); } meetingService.Delete(existing); if (await meetingService.SaveChangesAsync()) { return(Ok()); } } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } return(BadRequest("Failed to delete the meeting")); }
public async Task <IActionResult> Delete(Guid id) { try { var response = await _service.Delete(id); if (!response.IsSuccessful) { return(BadRequest(response)); } return(Ok(response)); } catch { return(StatusCode(500, "Internal Server Error.")); } }
public async Task <IActionResult> DeleteConfirmed(int id) { await _meetingService.Delete(id); return(RedirectToAction(nameof(Index))); }
// DELETE: api/Meeting/5 public void Delete(int id) { _meetingService.Delete(id); }
public IActionResult DeleteById(int id) { var status = _meetingService.Delete(id); return(Ok(status)); }