public static string LoggedInProfilePhoto(this UrlHelper urlHelper) { string mail = HttpContext.Current.Session["Mail"].ToString(); DbKutuphaneEntities db = new DbKutuphaneEntities(); var uye = db.Uyeler.FirstOrDefault(x => x.Mail == mail); string fileName = uye.Fotograf; return(urlHelper.ProfilePhoto(fileName)); }