asp.net mvc 3 刚接触,好多代码都不理解,比如这个sql ,啥意思,完全看不懂
varmanageList=(frommindb.Managementsjoinbindb.Buildingsonnew{BuildingCode=m.BuildingC...
var manageList = (from m in db.Managements
join b in db.Buildings
on new { BuildingCode = m.BuildingCode, SectionCode = m.SectionCode }
equals new { BuildingCode = b.BuildingCode, SectionCode = b.SectionCode }
where //(m.PermissFlag.Equals("0") || m.PermissFlag.Equals("1") || string.IsNullOrEmpty(m.PermissFlag) )
//&& (!string.IsNullOrEmpty(m.TradeCode))
b.EndFlag == 0
&& b.DeleteFlag == 0
&& (lstPersonCode.Contains(b.PersonCode1)
|| lstPersonCode.Contains(b.PersonCode2)
|| lstPersonCode.Contains(b.PersonCode3)
|| lstPersonCode.Contains(b.PersonCode4)
|| lstPersonCode.Contains(b.PersonCode5)
)
select m
); 展开
join b in db.Buildings
on new { BuildingCode = m.BuildingCode, SectionCode = m.SectionCode }
equals new { BuildingCode = b.BuildingCode, SectionCode = b.SectionCode }
where //(m.PermissFlag.Equals("0") || m.PermissFlag.Equals("1") || string.IsNullOrEmpty(m.PermissFlag) )
//&& (!string.IsNullOrEmpty(m.TradeCode))
b.EndFlag == 0
&& b.DeleteFlag == 0
&& (lstPersonCode.Contains(b.PersonCode1)
|| lstPersonCode.Contains(b.PersonCode2)
|| lstPersonCode.Contains(b.PersonCode3)
|| lstPersonCode.Contains(b.PersonCode4)
|| lstPersonCode.Contains(b.PersonCode5)
)
select m
); 展开
1个回答
展开全部
这sql和mvc没多大关系,这里.netfremawork3.5的linq语法
去msdn看下相关介绍和语法 http://msdn.microsoft.com/zh-cn/library/bb397933(v=vs.90).aspx
去msdn看下相关介绍和语法 http://msdn.microsoft.com/zh-cn/library/bb397933(v=vs.90).aspx
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询