public ActionResult Index() { IdentityRole adRole = db.Roles.First(r => r.Name == "Admin"); int users = db.Set <IdentityUserRole>().Count(r => r.RoleId != adRole.Id); ViewBag.Users = users; ViewBag.Jobs = db.Jobs.Where(c => c.Completed == false).Count(); ViewBag.SJobs = db.Jobs.Where(c => c.Completed == true).Where(c => c.EndDate >= DbFunctions.AddDays(DateTime.UtcNow, -30)).Count(); return(View()); }
public IdentityReadRepository(IdentityDb db) { _db = db; _dbSet = _db.Set <TEntity>(); }