相关疑难解决方法(0)

动态 Linq 谓词使用 C# MongoDB 驱动程序引发“不支持的过滤器”错误

我一直在尝试使用 Linq 将表达式的动态列表传递给 MongoDB C# 驱动程序查询......例如,此方法适用于针对 ORM 的常规 Linq 查询,但在应用于 MongoDB 查询时会导致错误...(仅供参考:我也在使用 LinqKit 的 PredicateBuilder)

//
// I create a List of Expressions which I can then add individual predicates to on an 
// "as-needed" basis.
    var filters = new List<Expression<Func<Session, Boolean>>>();

//
// If the Region DropDownList returns a value then add an expression to match it.
// (the WebFormsService is a home built service for extracting data from the various 
// WebForms Server Controls... in case you're wondering …
Run Code Online (Sandbox Code Playgroud)

c# linq mongodb mongo-c-driver mongodb-.net-driver

5
推荐指数
1
解决办法
7520
查看次数

标签 统计

c# ×1

linq ×1

mongo-c-driver ×1

mongodb ×1

mongodb-.net-driver ×1