Exemplo n.º 1
0
        public IEnumerable <FieldType> GetFields()
        {
            yield return(Field <CarroType>(name: "carro",
                                           arguments: new QueryArguments(new QueryArgument <NonNullGraphType <CarroQueryInput> >
            {
                Name = nameof(CarroQueryInput)
            }),
                                           resolve: ctx => _locadouraDao.GetCarroById(ctx.GetArgument <Carro>(nameof(Carro).ToLower()))));

            yield return(Field <ListGraphType <CarroType> >(name: "carros",
                                                            resolve: ctx => _locadouraDao.GetCarros()));
        }
Exemplo n.º 2
0
        public IEnumerable <Carro> Get()
        {
            var lista = _locadoraDao.GetCarros();

            return(lista);
        }