Ejemplo n.º 1
0
    public StarWarsQuery(StarWarsDB db)
    {
        Field <JediType>(
            "jedi",
            arguments: new QueryArguments(new QueryArgument <IntGraphType> {
            Name = "id"
        }),
            resolve: context => db.GetJedis().SingleOrDefault(j => j.Id == context.GetArgument <int>("id")));

        Field <ListGraphType <JediType> >(
            "jedis",
            resolve: context => db.GetJedis());
    }
Ejemplo n.º 2
0
 public Jedi GetJedi(int id)
 {
     return(StarWarsDB.GetJedis().SingleOrDefault(j => j.Id == id));
 }
Ejemplo n.º 3
0
 public IEnumerable <Jedi> GetJedis()
 {
     return(StarWarsDB.GetJedis());
 }