public AccountController() { var Model = new CabinetViewModel { AhcivementModel = new AhcivementModel(), CabinetModel = new CabinetModel() }; return View(Model); }
// // GET: /Manage/Index public async Task<ActionResult> Index(ManageMessageId? message) { CabinetViewModel Model = new CabinetViewModel(); ApplicationDbContext DB = new ApplicationDbContext(); Model.User = DB.Users.First(c => c.UserName == User.Identity.Name); Model.Tasks = DB.Tasks.Where(c => c.UserID == Model.User.Id); Model.TaskCount = Model.Tasks.ToList().Count; Model.SolveCount = DB.Solves.Count(c => c.UserID == Model.User.Id); Model.Comments = DB.Comments.Count(c => c.UserID == Model.User.Id); return View(Model); }