Ejemplo n.º 1
0
        public async void GetById_MatcheResult()
        {
            People result = await _peopleUseCase.GetById(1);

            Assert.Equal(people.Name, result.Name);
            Assert.Equal(people, result);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetById(int id)
        {
            if (id == 0)
            {
                return(BadRequest());
            }

            People people = await _peopleUseCase.GetById(id);

            if (people == null)
            {
                return(NotFound());
            }

            List <Car> car = await _carUseCase.GetCarsByPeopleId(id);

            PeopleDTO peopleDTO = PeopleMapper.MapperModelToDTO(people, car);

            return(Ok(peopleDTO));
        }