Пример #1
0
        public async Task <IActionResult> GetProjects([FromQuery] ProjectParams projectParams)
        {
            var projectsFromRepo = await _repo.GetProjects(projectParams);

            var projects = _mapper.Map <IEnumerable <ProjectShortDto> >(projectsFromRepo);

            return(Ok(new { projects, projectParams.Length }));
        }
        public async Task <IActionResult> Index()
        {
            var userId   = User.GetUserId();
            var projects = await _repo.GetProjects(userId);

            var projectsToReturn = _mapper.Map <ProjectListItemDto[]>(projects);

            return(Ok(projectsToReturn));
        }