public IHttpActionResult Delete(int id) { try { return(Ok(context.Delete(id))); } catch (Exception ex) { return(Content(HttpStatusCode.NotModified, ex.Message)); } }
public async Task <IActionResult> Delete(int id) { try { return(Ok(await context.Delete(id))); } catch (Exception ex) { return(BadRequest(new ErrorMessage(ex.Message))); } }