コード例 #1
0
ファイル: HtmlHelpers.cs プロジェクト: ProsiakLtd/prosiak
        public static FileContentResult Thumbnail(this HtmlHelper helper, string isbn)
        {
            var path = Thumbnails.GetThumbnailDiskPath(isbn);

            byte[] byteArray = System.IO.File.ReadAllBytes(path);
            return(new FileContentResult(byteArray, "image/jpeg"));
        }
コード例 #2
0
ファイル: HtmlHelpers.cs プロジェクト: ProsiakLtd/prosiak
        public static string ThumbnailPath(this HtmlHelper helper, string isbn = "empty")
        {
            var path = Thumbnails.GetThumbnailDiskPath(isbn);

            if (System.IO.File.Exists(path))
            {
                return("~/Content/Thumbnails/" + isbn + ".jpg");
            }
            else
            {
                return("~/Content/Thumbnails/empty.jpg");
            }
        }