Ejemplo n.º 1
0
        public void PotionsSelect()
        {
            PotionRepository repo = new PotionRepository(new PotionSQLContext());
            List <Potion>    c    = repo.GetAll();

            Assert.IsNotNull(c, "Potions weren't correctly retrieved");
        }
Ejemplo n.º 2
0
        public PotionQuery(PotionRepository potionRepository)
        {
            Field <ListGraphType <PotionType> >(
                "potions",
                resolve: context => potionRepository.GetAll()

                );

            Field <PotionType>(
                "potion",
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <IdGraphType> >
            {
                Name = "id"
            }),
                resolve: context =>
            {
                var id = context.GetArgument <int>("id");
                return(potionRepository.Get(id));
            }
                );
        }