public override string[] GetRolesForUser(string username) { BlogYazilimEntities2 db = new BlogYazilimEntities2(); var kullanicivr = db.Kullanici.FirstOrDefault(x => x.KullaniciAdi == username); return(new string[] { kullanicivr.Role }); }
// GET: PanelDashboard public ActionResult Index() { BlogYazilimEntities2 db = new BlogYazilimEntities2(); ViewModels.DashboardVM vm = new ViewModels.DashboardVM(); vm.Makale = db.Makale.ToList(); vm.Kategori = db.Kategori.ToList(); vm.Kullanici = db.Kullanici.ToList(); vm.MakaleSon = db.Makale.OrderByDescending(x => x.EklenmeTarihi).Take(1).ToList(); vm.MakaleGoruntulenme = db.Makale.OrderByDescending(x => x.GoruntulenmeSayisi).ToList(); return(View(vm)); }