【发布时间】:2014-10-13 18:24:10
【问题描述】:
这是我的 edmx 图。
我正在尝试获取特定 ProfileId 的所有驱动器
这是我写的查询
var prof = (from p in pe.UserDrives.Include("Drive")
where p.ProfileId == Cuser.ProfileId
select p).ToList();
数据:
Drive
Id googleAccount RefreshToken AccessToken
1 Cloud NULL NULL
2 Storage NULL NULL
UserDrive
DriveId Id ProfileId
1 1 1
2 2 1
我会得到的结果是 profileId =1 的驱动器信息将是来自 userdrive 的 2 条记录及其相应的驱动器信息
相反,我希望对于选定的配置文件有一个驱动记录列表
请回答新手问题。我只是在学习
【问题讨论】:
标签: sql-server entity-framework asp.net-mvc-5 entity-framework-6