Ejemplo n.º 1
0
        public async Task <ActionResult <IEnumerable <Agency> > > GetByCodeAsync(
            [FromServices] IAgencyRepository repository,
            [FromRoute] string code
            )
        {
            var agency = await repository.GetByCode(code);

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

            return(Ok(agency));
        }