示例#1
0
        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));
            });
        }
示例#2
0
 public CashFlowService(CashFlowProxy cashFlowProxy)
 {
     _cashFlowProxy = cashFlowProxy;
 }
示例#3
0
 public GraphQLController(AccountDetailProxy accountDetailProxy, CashFlowProxy cashFlowProxy, CustomerProxy customerProxy)
 {
     _accountDetailsProxy = accountDetailProxy;
     _cashFlowProxy       = cashFlowProxy;
     _customerProxy       = customerProxy;
 }