-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.4.2
-
Component/s: None
-
None
public sealed class Document
{
public string Id
public List<string> Folders { get; set; }
}
public sealed class Folder
{
public string Id
}
1. var documentFolders = documentCollection.AsQueryable().Where(x => x.Id == "document1").Select(x => x.Folders).Single();
2. var folders = folderCollection.AsQueryable().Where(x => documentFolders.Contains(x.Id)).ToArray();
3. Got this ArgumentException:
Unsupported where clause: System.Collections.Generic.List`1[System.String].Contains(x.Id).
Stack trace:
at MongoDB.Driver.Linq.SelectQuery.BuildQuery(Expression expression) in C:\work\10gen\mongodb\mongo-csharp-driver\Driver\Linq\Translators\SelectQuery.cs:line 862
at MongoDB.Driver.Linq.SelectQuery.BuildQuery() in C:\work\10gen\mongodb\mongo-csharp-driver\Driver\Linq\Translators\SelectQuery.cs:line 123
at MongoDB.Driver.Linq.SelectQuery.Execute() in C:\work\10gen\mongodb\mongo-csharp-driver\Driver\Linq\Translators\SelectQuery.cs:line 132
at MongoDB.Driver.Linq.MongoQueryProvider.Execute(Expression expression) in C:\work\10gen\mongodb\mongo-csharp-driver\Driver\Linq\MongoQueryProvider.cs:line 147
at MongoDB.Driver.Linq.MongoQueryable`1.GetEnumerator() in C:\work\10gen\mongodb\mongo-csharp-driver\Driver\Linq\MongoQueryable.cs:line 81
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at DAL.MyService.MyMethod(String rId) in D:\file1.cs:line 176
at DynamicModule.ns.Wrapped_INavigationServiceRepository_364d6b61519c4b838c96d681fbc90833.<GetObjectParents_DelegateImplementation>__1(IMethodInvocation inputs, GetNextInterceptionBehaviorDelegate getNext)
- related to
-
CSHARP-2247 Support array.Contains(value) == false in LINQ queries
- Closed
1.
|
This does not work anymore | CSHARP-2244 | Closed | Unassigned |