public JsonResult Create(EditorViewModel model)
 {
     if (ModelState.IsValid)
     {
         var tags = Entities.ParseTags(model.TagString);
         var presentation = new Presentation
         {
             Title = model.Title,
             Description = model.Description,
             Json = model.Json,
             HtmlContents = model.HtmlContents,
             Tags = tags,
             UserName = User.Identity.Name
         };
         try
         {
             Entities.AddToPresentations(presentation);
             EntitiesIndexer.AddPresentationToIndex(presentation);
             var cm = new WebPresentationsCacheManager();
             cm.Flush();
         }
         catch
         {
             return Json("Fail");
         }
         return Json("Success");
     }
     return Json("Fail");
 }
 //
 // GET: /Editor/Update
 public JsonResult Update(int id, string jsonString, string htmlContents)
 {
     var presentation = Entities.GetPresentation(id);
     if (presentation != null)
     {
         if (Entities.UserOwnsPresentation(id, User.Identity.Name))
         {
             try
             {
                 presentation.Json = jsonString;
                 presentation.HtmlContents = htmlContents;
                 Entities.Update();
                 EntitiesIndexer.UpdatePresentationIndex(presentation);
                 var cm = new WebPresentationsCacheManager();
                 cm.Flush();
             }
             catch
             {
                 return Json(new {message = "Fail"});
             }
             return Json(new {message = "Success"});
         }
     }
     return Json(new { message = "Fail" });
 }