コード例 #1
0
 public IEnumerable <Project> GetAll(int?userId = null)
 {
     if (userId.HasValue)
     {
         return(_repo.Get(p => p.UserId == userId));
     }
     return(_repo.Get());
 }
コード例 #2
0
        public ProjectViewModel Get(int id)
        {
            var projectViewModel = new ProjectViewModel();

            var project = _projectRepo.Get(id);

            if (project != null)
            {
                projectViewModel = _mapper.Map <ProjectViewModel>(project);
            }

            return(projectViewModel);
        }