public BFDQuery(AccountDetailProxy accountDetailProxy, CashFlowProxy cashFlowProxy, CustomerProxy customerProxy) { Name = "Query"; Description = "....."; Field <ListGraphType <CashFlowType> >( "CashFlow", resolve: context => cashFlowProxy.GetCashFlowDetails()); Field <ListGraphType <AccountBalanceType> >( "AccountBalance", resolve: context => accountDetailProxy.GetAccountBalances()); Field <ListGraphType <CustomerType> >( "Customer", resolve: context => customerProxy.GetCustomerList()); Field <CustomerType>( "GetCustomerByCustomerId", arguments: new QueryArguments( new QueryArgument <NonNullGraphType <IntGraphType> > { Name = "customerId" } ), resolve: context => { var customerId = context.GetArgument <int>("customerId"); return(customerProxy.GetCustomerById(customerId)); }); }
public CustomerType() { Name = "Customer"; Description = "Customer Related Informations"; Field(x => x.CustomerId).Description("Customer Id"); Field(x => x.Name).Description("Name"); Field <ListGraphType <AccountBalanceType> >( "AccountBalance", resolve: context => accountDetailProxy.GetAccountBalances() .Where(x => x.CustomerId == context.Source.CustomerId).ToList()); Field <ListGraphType <CashFlowType> >( "CashFlow", resolve: context => cashFlowProxy.GetCashFlowDetails() .Where(x => x.CustomerId == context.Source.CustomerId).ToList()); }
public List <CashFlow> GetCashFlowDetails() { return(_cashFlowProxy.GetCashFlowDetails()); }