public async Task <ActionResult <Project2ReturnDto> > GetProject(int id) { var spec = new ProjectsWithTYSpec(id); var project = await _projectsRepo.GetEntityWithSpec(spec); return(_mapper.Map <Project, Project2ReturnDto>(project)); }
public async Task <ActionResult <IReadOnlyList <Project2ReturnDto> > > GetProjects(int?typeId, int?yearId) { var spec = new ProjectsWithTYSpec(typeId, yearId); var projects = await _projectsRepo.ListAsync(spec); return(Ok(_mapper.Map <IReadOnlyList <Project>, IReadOnlyList <Project2ReturnDto> >(projects))); }