Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
        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));
        }