public CommentProcessorPipeline(IComment commentRepository, ISettings settingsRepository, IAkismetService akismetService, IError error, CommentEntity commentEntity, RequestData requestData) { _commentRepository = commentRepository; _settingsRepository = settingsRepository; _akismetService = akismetService; _error = error; _commentEntity = commentEntity; _requestData = requestData; }
private static CommentInfo GetCommentInfo(IEnumerable<PostEntity> posts, CommentEntity commentEntity, int status) { var info = new CommentInfo { Comment = commentEntity, Post = posts.Single(p => p.PostID == commentEntity.PostID) }; var links = new List<CommentLink>(); CommentLinkType.GetTypes(commentEntity.CommentStatus).ForEach(t => { var methodName = status == int.MaxValue ? "CommentPartial" : "CommentPartialReplacer"; links.Add(new CommentLink { CommentID = commentEntity.CommentID, PostID = commentEntity.PostID, LinkText = t.Description, ActionMethod = methodName, CommentStatus = t.Status }); }); info.Links = links; return info; }
public static AkismetComment Create(CommentEntity commentEntity, RequestData requestData) { return new AkismetComment { Blog = requestData.Blog, UserIp = requestData.UserIp, UserAgent = requestData.UserAgent, Referrer = requestData.Referrer, Permalink = null, CommentType = "blog", CommentAuthor = commentEntity.CommentUserFullName, CommentAuthorEmail = commentEntity.CommenterEmail, CommentAuthorUrl = commentEntity.CommenterSite, CommentContent = commentEntity.CommentContent }; }
private CommentProcessorPipeline GetCommentProcessor(CommentEntity commentEntity) { _akismetService = new Akismet.Akismet(SettingsRepository.BlogAkismetKey, SettingsRepository.BlogAkismetUrl, Request.UserAgent); return new CommentProcessorPipeline(_commentsRepository, SettingsRepository, _akismetService, _errorLogger, commentEntity, GetRequestData()); }
public void AddComment(CommentEntity commentEntity) { commentEntity.CommentPostedDate = DateTime.Now; _commentsTable.InsertOnSubmit(commentEntity); context.SubmitChanges(); }
private CommentEntity GetSpamComment(int commentID, int postID) { var commentEntity = new CommentEntity {CommentID = commentID, PostID = postID, CommentContent = "idiot"}; return commentEntity; }
private CommentEntity GetHamComment(int commentID, int postID) { var commentEntity = new CommentEntity {CommentID = commentID, PostID = postID, CommentContent = "how does this work?"}; return commentEntity; }
public void AddComment(CommentEntity commentEntity) { _commentsTable.Add(commentEntity); }