Пример #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());
    }
Пример #2
0
 public Jedi GetJedi(int id)
 {
     return(StarWarsDB.GetJedis().SingleOrDefault(j => j.Id == id));
 }
Пример #3
0
 public IEnumerable <Jedi> GetJedis()
 {
     return(StarWarsDB.GetJedis());
 }