示例#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 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());
        }
示例#3
0
 public List <CashFlow> GetCashFlowDetails()
 {
     return(_cashFlowProxy.GetCashFlowDetails());
 }