Example #1
0
        public async Task <ProjectManagerItem> GetUserProjects(Guid userIdentifier)
        {
            var projectManager = await _projectMangerRepository.GetByUserIdentifierAsync(userIdentifier);

            return(projectManager == null ? null :
                   new ProjectManagerItem {
                Id = projectManager.Id,
                Projects = projectManager.Projects == null ?
                           new List <ProjectItem>() :
                           projectManager.Projects.Select(p => new ProjectItem {
                    Id = p.Id,
                    Title = p.Title,
                    StartDate = p.StartDate,
                    FinishDate = p.FinishDate,
                    CreatedDate = p.CreatedDate
                }).ToList()
            });
        }