我有三个表,即“项目”、“平台”、“详细信息”。
我从 Projects 表、Platforms 表和 Details 表中收集了详细信息。从详细信息表中,我们可能会得到多个值或单个值。
我已经编写了如下的 Linq 查询:
using (PEntities CSProject = new PEntities())
{
projectId = (from _project in CSProject.Projects
where _project.ProjectName == project
select _project.ProjectId).SingleOrDefault();
platformId = (from platformID in CSProject.Projects
where platformID.ProjectName == project
select platformID.PlatformId).SingleOrDefault();
platformName = (from platfrmName in CSProject.Platforms
where platfrmName.PlatformId == platformId
select platfrmName.PlatformName).SingleOrDefault();
cSProjectId = (from _csproject in CSProject.Details
where _csproject.ProjectId == projectId
select _csproject.CsprojectId).ToList<long?>();
}
您能帮我在一行中编写上述所有查询吗?