public void AddBlogEntry(BlogEntry blogEntry) { var time = DateTime.Now; blogEntry.Modified = time; blogEntry.Created = time; DataBase.Insert(blogEntry); }
public void AddBlogEntryFile(BlogEntryFile blogEntryFile, BlogEntry blogEntry) { var time = DateTime.Now; blogEntryFile.BlogEntryId = blogEntry.Id; blogEntryFile.Created = time; blogEntryFile.Modified = time; DataBase.Insert(blogEntryFile); }
public void AddBlogEntryComment(BlogEntryComment blogEntryComment, BlogEntry blogEntry, bool isAdminPost) { var time = DateTime.Now; blogEntryComment.Created = time; blogEntryComment.Modified = time; blogEntryComment.AdminPost = isAdminPost; blogEntryComment.BlogEntryId = blogEntry.Id; DataBase.Insert(blogEntryComment); }
public void UpdateBlogEntryComment(BlogEntryComment blogEntryComment, BlogEntry blogEntry) { blogEntryComment.Modified = DateTime.Now; blogEntryComment.BlogEntryId = blogEntry.Id; DataBase.Update(blogEntryComment); }
public void DeleteBlogEntry(BlogEntry blogEntry) { throw new NotImplementedException(); }
public void UpdateBlogEntry(BlogEntry blogEntry) { blogEntry.Modified = DateTime.Now; DataBase.Update(blogEntry); }
public BlogEntry[] GetRelatedBlogEntries(BlogEntry blogEntry) { var tagIds = blogEntry.Tags.Select(t => t.Id).ToArray(); var query = GetAllEntries() .Where(e => e.Visible && e.PublishDate <= DateTime.Now && e.Id != blogEntry.Id) .Where(e => e.Tags.Any(t => tagIds.Contains(t.Id))) .OrderByDescending(e => e.Tags.Count(t => tagIds.Contains(t.Id))) .ThenByDescending(e => e.Created) .Take(3) .ToArray(); return query; }
public void UpdateBlogEntryFile(BlogEntryFile blogEntryFile, BlogEntry blogEntry) { blogEntryFile.Modified = DateTime.Now; DataBase.Update(blogEntryFile); }