public CustomerQuery(CustomerVector vector) { Field <ListGraphType <CustomerType> >( "customers" , resolve: context => vector.GetAllModels() ); }
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"]) ); }
public WorldWideQuery(OrderVector oVector, CustomerVector cVector) { Field <ListGraphType <OrderType> >( "orders" , resolve: context => oVector.GetAllModels() ); Field <ListGraphType <CustomerType> >( "customers" , resolve: context => cVector.GetAllModels() ); }
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()) ); }
public CustomerController(CustomerVector vector) => Vector = vector;