c# - linq to sql使用lambda连接多列

标签 c# sql linq lambda

谁能帮我翻译一下

var query = from s in context.ShoppingMalls
join h in context.Houses
on
new { s.CouncilCode, s.PostCode }
equals
 new { h.CouncilCode, h.PostCode }
select s;

进入 lambda 查询?

谢谢。

最佳答案

var query = context.ShoppingMalls
                   .Join(
                       context.Houses,
                       s => new { s.CouncilCode, s.PostCode },
                       h => new { h.CouncilCode, h.PostCode },
                       (s, h) => s);

关于c# - linq to sql使用lambda连接多列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10317117/

相关文章:

c# - 将更改后的元素保存回 XML 文件

c# - Double.Parse 不能保留逗号

sql - 如何在 SSIS 中截断多个表(使用 ADO.NET 目标和 Oracle 数据库)

mysql - 如何混合列数据

mysql - 在给定登机和下机时间的情况下查找每小时载客量

.net - 如何将 System.Data.Linq.Binary 转换为流?

c# - C# 中是否有类似 VB.NET 的运算符?

c# - 常量是否固定在 C# 中?

c# - .NET Entity Framework : Add-Migration is too slow

c# - XML : how to remove all nodes which have no attributes nor child elements