表一:测站表 GW_R_MZ
主键:测站编码STCD
其他:水位WL
表二:行政区表 GW_B_STRGR
主键:测站编码STCD
其他:行政区划ADDVCD
已从前端获取由用户输入的行政区划ADDVCD为“北京市“,希望筛选表一的信息。
IQueryable<GW_R_MZ> res = _db.GW_R_MZ;
if (!string.IsNullOrEmpty(addvcd))
{
res=XXXXXXX
}
参考根据测站编码筛选,以获取stcd的值
if (!string.IsNullOrEmpty(stcd))
{
stcd = stcd.Trim();
res = res.Where(n => n.STCD.Contains(stcd));
}