首页 新闻 会员 周边

MongoCollection 有没有类似ef 那种whereif的扩展

0
[已解决问题] 解决于 2020-08-12 09:46

MongoCollection 有没有类似ef 那种whereif的扩展

半岛枫叶的主页 半岛枫叶 | 菜鸟二级 | 园豆:206
提问于:2019-09-26 13:13
< >
分享
最佳答案
0

public static IQueryable<T> WhereIf<T>(this IQueryable<T> source, bool condition, string path)
{
return condition
? source.Where(path)
: source;
}

半岛枫叶 | 菜鸟二级 |园豆:206 | 2020-08-11 15:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册