예제 #1
0
파일: PathHelper.cs 프로젝트: luowei98/YiHe
        public static string ArticlePicture(Article article)
        {
            string path = article
                .Category
                .Chain
                .Aggregate("", (curr, category) => curr + "/" + category.Name);

            return string.Format(
                "article{0}/{1}",
                path,
                article.Picture);
        }
예제 #2
0
파일: PathHelper.cs 프로젝트: luowei98/YiHe
        public static string ArticleSmallPicture(Article article)
        {
            string path = article
                .Category
                .Chain
                .Aggregate("", (curr, category) =>
                               curr + Path.DirectorySeparatorChar.ToString() + category.Name);

            return string.Format(
                "article/{0}/{1}s{2}",
                path,
                Path.GetFileNameWithoutExtension(article.Picture),
                Path.GetExtension(article.Picture));
        }