Exemple #1
0
        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"));
        }
Exemple #2
0
        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");
            }
        }