Example #1
0
 public PostViewModel(Post post)
 {
     var g = new NGravatar.Gravatar();
     
     BoardId = post.Board.BoardId;
     PostId = post.PostId;
     OwnerId = post.Owner.CompetitorId;
     OwnerName = post.Owner.Name;
     GravatarLink = g.GetImageSource(post.Owner.Profile.EmailAddress);
     Body = HtmlSanitizer.Sanitizer(post.Body, new Regex("^(br|a)$"), HtmlSanitizer.ForbiddenTags).Val;
     Created = String.Format("{0:g}", post.Created);
     Edited = String.Format("{0:g}", post.Edited);
 }
Example #2
0
        public PostViewModel(Post post)
        {
            var g = new NGravatar.Gravatar();

            BoardId      = post.Board.BoardId;
            PostId       = post.PostId;
            OwnerId      = post.Owner.CompetitorId;
            OwnerName    = post.Owner.Name;
            GravatarLink = g.GetImageSource(post.Owner.Profile.EmailAddress);
            Body         = HtmlSanitizer.Sanitizer(post.Body, new Regex("^(br|a)$"), HtmlSanitizer.ForbiddenTags).Val;
            Created      = String.Format("{0:g}", post.Created);
            Edited       = String.Format("{0:g}", post.Edited);
        }