Exemplo n.º 1
0
        public WorldWideQuery(OrderVector oVector, CustomerVector cVector)
        {
            Field <ListGraphType <OrderType> >(
                "orders"
                , resolve: context => oVector.GetAllModels()
                );

            Field <ListGraphType <CustomerType> >(
                "customers"
                , resolve: context => cVector.GetAllModels()
                );

            Field <ListGraphType <CustomerType> >(
                "customer",
                "Get Customer By ID",
                new QueryArguments(
                    new QueryArgument <IntGraphType> {
                Name = "customerID"
            }
                    )
                , resolve: context => cVector.GetAllModels()
                .Result.Where(md => md.CustomerID == (int)context.Arguments["customerID"])

                );
        }
Exemplo n.º 2
0
 public OrderQuery(OrderVector vector)
 {
     Field <ListGraphType <OrderType> >(
         "orders"
         , resolve: context => vector.GetAllModels()
         );
 }
Exemplo n.º 3
0
        public WorldWideQuery(OrderVector oVector, CustomerVector cVector)
        {
            Field <ListGraphType <OrderType> >(
                "orders"
                , resolve: context => oVector.GetAllModels()
                );

            Field <ListGraphType <CustomerType> >(
                "customers"
                , resolve: context => cVector.GetAllModels()
                );
        }