我有以下查询,我将其放入DataGrid:
var balancePerAccount = from bal in data.balanceDetails
                        join acc in data.userPaymentDetails on bal.userName equals acc.userName
                        where bal.paymentID == 0
                        group bal by bal.userName into g
                        where g.Sum(p => p.rebateBeforeService) >= 20
                        select new
                        {
                            Username = g.Key,
                            Amount = g.Sum(p => p.rebateBeforeService),
                        };
dgPaymentsPending.DataSource = balancePerAccount;
dgPaymentsPending.DataBind();
我想做的是acc在select. 例如我想添加PaymentProvider = acc.PaymentProvider. 我尝试了所有我能想到的方法,包括First()从组中获取并尝试从那里访问它,但我似乎找不到访问它的方法。我可能只是遗漏了一些非常简单的东西,但我已经在 Google 上搜索了一段时间,但似乎找不到可比较的示例。有人有想法吗?