Comment IBlogRepository.CreateComment() { var Result = new Comment(); this.Context.Comments.Add(Result); return Result; }
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); } } }
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); } } }