public ActionResult ApprovePost(int Id) { BlogEntry model = repo.GetFromQueue(Id); model.ConvertTagListToUnprocessed(); return(View(model)); }
public void Add(BlogEntry newBlog) { newBlog.ConvertTagListToUnprocessed(); using (var context = new EFEntities()) { EFBlogEntry forUpdate = context.BlogEntries.SingleOrDefault(p => p.BlogId == newBlog.BlogId); forUpdate.Title = newBlog.Title; forUpdate.FullText = newBlog.FullText; forUpdate.PreviewText = newBlog.PreviewText; forUpdate.TagListString = newBlog.UnprocessedTags; forUpdate.Author = newBlog.Author; forUpdate.Posted = true; context.SaveChanges(); } }
public void AddToQueue(BlogEntry x) { x.ConvertTagListToUnprocessed(); var addResult = new EFBlogEntry() { BlogId = x.BlogId, DateCreated = x.DateCreated, FullText = x.FullText, Author = x.Author, PreviewText = x.PreviewText, Title = x.Title, CategoryId = x.Category.Id, TagListString = x.UnprocessedTags, Posted = false }; using (var context = new EFEntities()) { context.BlogEntries.Add(addResult); context.SaveChanges(); } }