public IEnumerable <Project> GetAll(int?userId = null) { if (userId.HasValue) { return(_repo.Get(p => p.UserId == userId)); } return(_repo.Get()); }
public ProjectViewModel Get(int id) { var projectViewModel = new ProjectViewModel(); var project = _projectRepo.Get(id); if (project != null) { projectViewModel = _mapper.Map <ProjectViewModel>(project); } return(projectViewModel); }