Esempio n. 1
0
        public IActionResult Index()
        {
            var idUser = _userTable.GetUserId(HttpContext.User.Identity.Name);
            var model  = new PeopleViewModel()
            {
                Projects = new List <ProjectPeopleModel>()
            };
            var projects = _projectTable.GetProjectsByUserId(idUser);

            foreach (var project in projects)
            {
                var pp = new ProjectPeopleModel()
                {
                    ProjectName  = project.Name,
                    ProjectUsers = _userTable.GetUsersInProjectByProjectId(project.IdProject)
                };
                model.Projects.Add(pp);
            }
            return(View(model));
        }