Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 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
     };
 }
Exemplo n.º 4
0
 private CommentProcessorPipeline GetCommentProcessor(CommentEntity commentEntity)
 {
     _akismetService = new Akismet.Akismet(SettingsRepository.BlogAkismetKey,
                                           SettingsRepository.BlogAkismetUrl,
                                           Request.UserAgent);
     return new CommentProcessorPipeline(_commentsRepository, SettingsRepository, _akismetService, _errorLogger, commentEntity, GetRequestData());
 }
Exemplo n.º 5
0
Arquivo: Comment.cs Projeto: LByron/BS
 public void AddComment(CommentEntity commentEntity)
 {
     commentEntity.CommentPostedDate = DateTime.Now;
     _commentsTable.InsertOnSubmit(commentEntity);
     context.SubmitChanges();
 }
Exemplo n.º 6
0
        private CommentEntity GetSpamComment(int commentID, int postID)
        {
            var commentEntity = new CommentEntity {CommentID = commentID, PostID = postID, CommentContent = "idiot"};

            return commentEntity;
        }
Exemplo n.º 7
0
        private CommentEntity GetHamComment(int commentID, int postID)
        {
            var commentEntity = new CommentEntity
                {CommentID = commentID, PostID = postID, CommentContent = "how does this work?"};

            return commentEntity;
        }
Exemplo n.º 8
0
 public void AddComment(CommentEntity commentEntity)
 {
     _commentsTable.Add(commentEntity);
 }