-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Linq
-
None
var selectedIds = new[] { ObjectId.GenerateNewId() }; var result = postCollection .AsQueryable() .Where(p => selectedIds.Contains(p.Id) == false) .ToList();
Message: System.InvalidOperationException : Contains(value(MongoDB.Bson.ObjectId[])) is not supported.
Stack Trace:
PredicateTranslator.GetFieldExpression(Expression expression)
PredicateTranslator.TranslateComparison(Expression variableExpression, ExpressionType operatorType, ConstantExpression constantExpression)
PredicateTranslator.TranslateComparison(BinaryExpression binaryExpression)
PredicateTranslator.Translate(Expression node)
PredicateTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry)
QueryableTranslator.TranslateWhere(WhereExpression node)
QueryableTranslator.Translate(Expression node)
QueryableTranslator.TranslatePipeline(PipelineExpression node)
QueryableTranslator.Translate(Expression node)
QueryableTranslator.Translate(Expression node, IBsonSerializerRegistry serializerRegistry, ExpressionTranslationOptions translationOptions)
MongoQueryProviderImpl`1.Translate(Expression expression)
MongoQueryProviderImpl`1.Execute(Expression expression)
MongoQueryableImpl`2.GetEnumerator() List`1.ctor(IEnumerable`1 collection)
Enumerable.ToList[TSource](IEnumerable`1 source)
- is duplicated by
-
CSHARP-2247 Support array.Contains(value) == false in LINQ queries
- Closed