Ejemplo n.º 1
0
        public Query(IQuestionarioService service)
        {
            Field <ListGraphType <QuestaoType> >(
                Questoes,
                resolve: context =>
            {
                return(service.Get().Result);
            }
                );

            Field <ListGraphType <ProvaType> >(
                Rank,
                resolve: context =>
            {
                return(service.Rank().Result);
            }
                );

            Field <ListGraphType <ProvaType> >(
                Prova,
                arguments: new QueryArguments(
                    new QueryArgument <ProvaInputType> {
                Name = Input
            }
                    ),
                resolve: context =>
            {
                var prova = context.GetArgument <Prova>(Input);
                return(service.GetByEmail(prova?.Email).Result);
            }
                );
        }
Ejemplo n.º 2
0
 public Task <IEnumerable <Prova> > Rank()
 {
     return(_service.Rank());
 }