本文介绍了如何在linq中编写此代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select (case WHEN M.ID is NULL THEN '0' else M.ID END) AS mappingid,F.ID AS featureid,
(case WHEN M.ID is NULL THEN 'false' else 'true' END) AS Status,
F.Title as va,F.Description ,
F.IsActive,M.MembershipFeatureID as MFID,M.MembershipPlanID,M.No
from MembershipFeature F
left outer join Feature_Plan_Mapping M on M.MembershipFeatureID= F.ID
and M.MembershipPlanID=51
推荐答案
var query=from f in MembershipFeature join m in Feature_Plan_Mapping on M.MembershipFeatureID equals F.ID where M.MembershipPlanID=51
select new
{
MID=M.id==0? "0" : M.id
featureid=f.id,
status=M.id==0? "false" : "true"
f.title,
f.description,
F.IsActive,
M.MembershipFeatureID,
M.MembershipPlanID,
M.no
}
这篇关于如何在linq中编写此代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!