Exemplo n.º 1
0
        public IActionResult GetCountryOfAnthor(int authorId)
        {
            //TODO - Validate the author exists
            var country = _countryRepository.GetCountryOfAnAuthor(authorId);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var countryDto = new CountryDto
            {
                Id   = country.Id,
                Name = country.Name
            };

            return(Ok(countryDto));
        }