コード例 #1
0
 public static string PublishedPost(this IUrlResolver resolver, TagPostDisplay post)
 {
     // TODO: _resolver.UrlFor<BlogController>() + "/" + ...;
     return ("~/blog/" +
             post.Published.Year + "/" +
             post.Published.Month + "/" +
             post.Published.Day + "/" +
             post.Slug).ToFullUrl();
 }
コード例 #2
0
 public static string GetCommentsText(this IFohjinPage viewPage, TagPostDisplay post)
 {
     var commentCount = (post.Comments == null) ? 0 : post.Comments.Count();
     return "<a href=\"{0}#comments\">{1}</a>"
         .ToFormat(
             viewPage.UrlTo().PublishedPost(post),
            (commentCount == 1)
                ? "{0} comment".ToFormat(commentCount)
                : "{0} comments".ToFormat(commentCount));
 }