public ActionResult ViewTasks() { var user = _repositoryAppUser.Find(u => u.UserName.Equals(User.Identity.Name)); var us = user.FirstOrDefault(); var employee = _repositoryEmployee.GetForRegistration(us.Email); var tasks = _repositoryTask.GetTasks(employee.EmployeeId); ViewBag.Tasks = tasks.Any() ? tasks : null; ViewBag.Id = us.Id; return(PartialView(tasks)); }