コード例 #1
0
 public CustomerQuery(CustomerVector vector)
 {
     Field <ListGraphType <CustomerType> >(
         "customers"
         , resolve: context => vector.GetAllModels()
         );
 }
コード例 #2
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"])

                );
        }
コード例 #3
0
        public WorldWideQuery(OrderVector oVector, CustomerVector cVector)
        {
            Field <ListGraphType <OrderType> >(
                "orders"
                , resolve: context => oVector.GetAllModels()
                );

            Field <ListGraphType <CustomerType> >(
                "customers"
                , resolve: context => cVector.GetAllModels()
                );
        }
コード例 #4
0
        public CustomerQuery(CustomerVector vector)
        {
            Field <ListGraphType <CustomerType> >(
                "customers"
                , resolve: context => vector.GetAllModels()
                );

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

                );
        }
コード例 #5
0
 public CustomerController(CustomerVector vector)
 => Vector = vector;