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