Exemple #1
0
        public async Task <IActionResult> GetProjectMembers(int projectId, int roleId)
        {
            _logger.LogRequest("Getting members in project {projectId} with role {roleId}", projectId, roleId);

            var projects = await _projectMemberService.GetProjectMembers(projectId, roleId);

            var results = _mapper.Map <List <ProjectMemberDto> >(projects);

            _logger.LogResponse("Members in project {projectId} retrieved. Response body: {@results}", projectId, results);

            return(Ok(results));
        }
Exemple #2
0
        public override string Execute()
        {
            Console.WriteLine($"Trying to get members of project {Project}...");

            string message;

            var project = _projectService.GetProjectByName(Project).Result;

            if (project != null)
            {
                var roleId         = MemberRole.GetMemberRoleId(Role ?? string.Empty);
                var projectMembers = _projectMemberService.GetProjectMembers(project.Id, roleId).Result;

                message = projectMembers.Select(m => new MemberListViewModel
                {
                    UserId   = m.UserId,
                    Username = m.Username,
                    Role     = m.ProjectMemberRoleName
                }).ToListCliString($"Found {projectMembers.Count} project member(s):");
            }
            else
            {
                message = $"Project {Project} was not found";
            }

            return(message);
        }
Exemple #3
0
        public async Task <IActionResult> GetProjectMembers(int projectId, int roleId)
        {
            _logger.LogInformation("Getting members in project {projectId} with role {roleId}", projectId, roleId);

            var projects = await _projectMemberService.GetProjectMembers(projectId, roleId);

            var results = _mapper.Map <List <ProjectMemberDto> >(projects);

            return(Ok(results));
        }
Exemple #4
0
        public async Task <IActionResult> GetProjectMembers(int idProject)
        {
            var projectMemberList = await _projectMemberService.GetProjectMembers(idProject);

            return(Ok(new Response <List <ProjectMemberDTO> >(projectMemberList)));
        }