我可以使用listname.Join()方法将实体集加入列表(集合)。
例如,
var query = listName.Join(repository.GetQuery<MyCustomType>(),
list => list.CustomTypeId,
customType => customType.id,
(list, customType) => list);
这样可以正常工作,但它只返回与实体中列表集合相关的行。我还想在结果集中使用“MyCustomType”的实例。我如何实现这一目标?
答案 0 :(得分:2)
var query = listName.Join(repository.GetQuery<MyCustomType>(),
list => list.CustomTypeId,
customType => customType.id,
(list, customType) => new { l = list, c = customType } );