linq 多个left join 和 sql union all -> linq union 方法

 (
  from s in Base_SysMenus
  join r in Base_RoleRights on s.Menu_Id equals r.Menu_Id into temp
  from s_r in temp.DefaultIfEmpty()
 
  join u in Base_UserRoles on s_r.Roles_ID equals u.Roles_ID into temp2
  from t in temp2.DefaultIfEmpty()
  where s.Target=="Iframe" && t.User_ID=="48f3889c-af8d-401f-ada2-c383031af92d" && s.DeleteMark==1
  select new{Menu_Id= s.Menu_Id}
 ).Union(
  from s in Base_SysMenus
  join r in Base_UserGroupRights on s.Menu_Id equals r.Menu_Id into temp
  from s_r in temp.DefaultIfEmpty()
 
  join u in Base_UserInfoUserGroups on s_r.UserGroup_ID equals u.UserGroup_ID into temp2
  from t in temp2.DefaultIfEmpty()
  where s.Target=="Iframe" && t.User_ID=="48f3889c-af8d-401f-ada2-c383031af92d" && s.DeleteMark==1
  select new{Menu_Id= s.Menu_Id}
 ).Union(
  from s in Base_SysMenus
  join r in Base_UserRights on s.Menu_Id equals r.Menu_Id into temp
  from s_r in temp
  where s.Target=="Iframe" && s_r.User_ID=="48f3889c-af8d-401f-ada2-c383031af92d" && s.DeleteMark==1
  select new{Menu_Id= s.Menu_Id}
 )
 
上一篇:PHP Ajax简单实例


下一篇:LICEcap 录制Gif动画