public static string GetImage(int id) { using (var dao = new ImageDAO()) { return(dao.GetImage(id)); } }
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); } }