Пример #1
0
 public void AddBlogEntry(BlogEntry blogEntry)
 {
     var time = DateTime.Now;
     blogEntry.Modified = time;
     blogEntry.Created = time;
     DataBase.Insert(blogEntry);
 }
Пример #2
0
 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);
 }
Пример #5
0
 public void DeleteBlogEntry(BlogEntry blogEntry)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public void UpdateBlogEntry(BlogEntry blogEntry)
 {
     blogEntry.Modified = DateTime.Now;
     DataBase.Update(blogEntry);
 }
Пример #7
0
 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;
 }
Пример #8
0
 public void UpdateBlogEntryFile(BlogEntryFile blogEntryFile, BlogEntry blogEntry)
 {
     blogEntryFile.Modified = DateTime.Now;
     DataBase.Update(blogEntryFile);
 }