我有以下查询LINQ INNER JOIN - 返回两个表
var customers = from customer in context.tblAccounts
join assoc in context.tblAccountAssociations on customer.AccountCode equals assoc.ChildCode
where customer.AccountType == "S" || customer.AccountType == "P"
select customer, assoc;
C#不喜欢 “ASSOC” 结尾。
我的错误信息是:
名为“assoc命令”的局部变量不能在此范围内声明,因为它会给予不同的意义“assoc命令”,这已经是一个“孩子”范围用来表示别的东西。
我需要从两个表中返回所有列,然后用
的foreach(在客户VAR的客户)
难道你不能......改变变量的名字? – GregRos
您需要返回2个单独的对象还是需要填充客户对象的属性? –