public JsonResult Delete(int id) { try { _repository.DeleteNote(id); return(Json(new { Message = "Deleted" })); } catch (Exception ex) { return(Json(new { Message = "Unable to delete: " + ex })); } }