Пример #1
0
        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
        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));
        }