public HttpResponseMessage Delete() { try { _toDoBL.RemoveItem(); return(Request.CreateResponse(HttpStatusCode.Accepted)); } catch (Exception ex) { Logger.Error("ToDoController Unable to consume Delete:" + ex.Message + ex.StackTrace); var message = Request.CreateResponse(HttpStatusCode.InternalServerError); return(message); } finally { Dispose(); } }
public JsonResult DeleteCache() { string result = string.Empty; try { _toDoService.RemoveItem(); } catch (Exception ex) { Logger.Error("CacheController Unable to consume Delete:" + ex.Message + ex.StackTrace); result = "error"; } finally { Dispose(); } return(Json(result, JsonRequestBehavior.AllowGet)); }