日期:2014-05-20  浏览次数:20881 次

LINQ 请高手帮忙把这两句合并成一句
var date = from S in DC.Study
where S.RegDate >= beginDate && S.RegDate <= endDate
select S;

var Check = from S in date
join P in DC.Patient on S.PatientID equals P.pID
join R in DC.Result on S.StuID equals R.sID
where S.rMod == _mod
select new
{
姓名 = P.pName,
性别 = P.SexTitle
};

y谢谢了

------解决方案--------------------
C# code

var Check = from S in DC.Study
join P in DC.Patient on S.PatientID equals P.pID
join R in DC.Result on S.StuID equals R.sID
where  (S.RegDate >= beginDate && S.RegDate <= endDate) and (S.rMod equals _mod) 
select new
{
姓名 = P.pName,
性别 = P.SexTitle
};

------解决方案--------------------
var Check = from S in DC.Study
join P in DC.Patient on S.PatientID equals P.pID
join R in DC.Result on S.StuID equals R.sID
where S.RegDate >= beginDate && S.RegDate <= endDate && (S.rMod == _mod) 
select new
{
姓名 = P.pName,
性别 = P.SexTitle
};