Exemple #1
0
 public static string GetImage(int id)
 {
     using (var dao = new ImageDAO())
     {
         return(dao.GetImage(id));
     }
 }
Exemple #2
0
 public FileContentResult image(int id)
 {
     using (var dao = new ImageDAO())
     {
         string path = HostingEnvironment.MapPath(dao.GetImage(id));
         if (System.IO.File.Exists(path))
         {
             return(File(System.IO.File.ReadAllBytes(path), "image/png"));
         }
         return(null);
     }
 }