这里所实现的逻辑是,根据不同的组织类型,选择不同的判断条件
from b in user
where org.OrgType == (int)OrgTypeEnum.省 ? b.ProvinceId == org.Id
: org.OrgType == (int)OrgTypeEnum.市 ? b.CityId == org.Id
: org.OrgType == (int)OrgTypeEnum.区 ? b.AreaId == org.Id
: org.OrgType == (int)OrgTypeEnum.校 ? b.SchoolId == org.Id
: org.OrgType == (int)OrgTypeEnum.级 ? b.GradeId == org.Id
: org.OrgType == (int)OrgTypeEnum.班 ? b.ClassId == org.Id
: 1 == 1
//:1==1 就是sql里的else