/// <summary> /// this method is used to fetch all the Project Manager /// </summary> /// <param name="projectId">EmployeeId of the project </param> /// <returns>returns list of all the Project Manager</returns> public async Task <List <EmployeeBasicDetailsDto> > GetProjectManagerOfEmployee(Guid employeeId) { List <EmployeeBasicDetailsDto> results = new List <EmployeeBasicDetailsDto>(); var projectManager = await _projectManagementRepository.GetProjectManagerAsync(employeeId); foreach (var employee in projectManager) { string departmentName = string.Empty; string designationName = string.Empty; var empDetails = await _employeeRepository.GetEmployeeInformationAsync(employee); var department = await _departmentDesignationService.GetDepartment(empDetails.DepartmentDesignationId); if (department != null) { departmentName = department.Name; } var designation = await _departmentDesignationService.GetDesignation(empDetails.DepartmentDesignationId); if (designation != null) { designationName = designation.Title; } var result = new EmployeeBasicDetailsDto { Name = string.Format("{0} {1} {2}", empDetails.FirstName, empDetails.MiddleName, empDetails.LastName), Id = empDetails.Id, Designation = designationName, Department = departmentName }; results.Add(result); } return(results); }