Exemplo n.º 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));
            });
        }
Exemplo n.º 2
0
 public CashFlowService(CashFlowProxy cashFlowProxy)
 {
     _cashFlowProxy = cashFlowProxy;
 }
Exemplo n.º 3
0
 public GraphQLController(AccountDetailProxy accountDetailProxy, CashFlowProxy cashFlowProxy, CustomerProxy customerProxy)
 {
     _accountDetailsProxy = accountDetailProxy;
     _cashFlowProxy       = cashFlowProxy;
     _customerProxy       = customerProxy;
 }