Esempio n. 1
0
        public BancoQuery(BancoService bancoService)
        {
            Field <BancoType>(
                name: "banco",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: context =>
            {
                int id = (int)context.Arguments["id"];
                return(bancoService.GetBancoById(id));
            }
                );

            Field <ListGraphType <BancoType> >(
                name: "GetAllBancos",
                resolve: context => { return(bancoService.GetAllBancos()); }
                );
        }
Esempio n. 2
0
 public IActionResult GetAllBancos()
 {
     return(new ObjectResult(_bancoService.GetAllBancos()));
 }