Ejemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <PersonResponse> > > GetAll([FromServices] IStarWarsSource starWars)
        {
            var query = await starWars.GetPersonsAsync();

            var result = query.ToArray();

            return(Ok(PersonResponse.Map(result)));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <PersonResponse> > > GetSingle(string id, [FromServices] IStarWarsSource starWars)
        {
            var result = await starWars.GetPersonSingleAsync(id);

            return(Ok(PersonResponse.Map(result)));
        }