我是 Linq 的新手,想知道如何获取客户 ID 列表以及他们的交易计数
public class Transaction
{
public int TransactionId {get; set;}
public int CustomerId {get; set;}
}
public class Customer
{
public int ID {get; set;}
public string Name {get; set;}
public string Surname {get; set;}
}
我想我需要与客户一起进行交易,但不太确定如何计算。
var query = (from c in customers
join t in transactions on c.ID equals t.CustomerId