我有2个数据库表。一个带有Master Recors,另一个带有使用字典结构的详细记录。从字典表中选择字段使用Linq联接
我想从detailstable查询一些字段,这是返回具有所有相同标题ID的多个行。
有没有办法使用LINQ加入两个表
例如创建一个自定义记录
主表: ID MasterName 日期 ...
细节表 ID MasterID Key Value
伪代码: 从主在context.mastertable 加入详细context.detailstable 上master.ID == detail.masterID 选择新CustomClass { ID = master.ID, 名称= master.MasterName 的CustomField =( detailsvalue.where key ==“customfield”)+(detailvalue.where key ==“customfield2”) };
希望有人能帮助我。
grtz Luuk Krijnen