public ActionResult editor(string id, string title) { TextBlock block = BlockService.Get(id); if (block == null) block = new TextBlock { Title = title }; return View(block); }
public TextBlock Edit(string id, string title, string data) { TextBlock block = Get(id); if (block == null) block = new TextBlock(); block.Title = title; block.Content = data; block.Save(); Cached.Remove<TextBlock>(id); return block; }