Comment IBlogRepository.CreateComment()
        {
            var Result = new Comment();
            this.Context.Comments.Add(Result);

            return Result;
        }
Beispiel #2
0
 void IBlogEngine.RespondToComment(Comment response)
 {
     if (response.EntryId != 0 && (response.ResponseId != null && response.ResponseId != 0))
     {
         using (IBlogService DataService = new BlogEngineDataService(this.Config))
         {
             var Entry = DataService.Repository.GetEntries().Where(BEntry => BEntry.Id == response.EntryId).FirstOrDefault();
             var Comment = DataService.Repository.GetComments().Where(BCom => BCom.Id == response.ResponseId).FirstOrDefault();
             if (Entry != null && Comment != null)
                 DataService.AddComment(response);
         }
     }
 }
Beispiel #3
0
 void IBlogEngine.LeaveComment(Comment comment)
 {
     if (comment.EntryId != 0)
     {
         using (IBlogService DataService = new BlogEngineDataService(this.Config))
         {
             var Entry = DataService.Repository.GetEntries().Where(BEntry => BEntry.Id == comment.EntryId).FirstOrDefault();
             if(Entry != null)
                 DataService.AddComment(comment);
         }
     }
 }