var query = myCollection.AsQueryable();
var regex = new Regex("^Foo");
query = query.Where(x => regex.IsMatch(x.User["FullName"].ToString())); <--- Error hererunning this code I get this error:Unable to determine the serialization information for the expression: x.User.get_Item("FullName").ToString()Document is declared in this way:public class MyClass
{
[BsonId]
public ObjectId _id { get; set; }
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfDocuments)] //Tryied also Dynamic, Document, ArrayOfArray
public Dictionary<string, object> User { get; set; }
}Debugging Driver source code I found something strange. In BsonSerializationInfoFinder class, node.Method.Name must be ElementAt or get_Item while in this case it is ToString and it returns null raising the exception!
protected override BsonSerializationInfo VisitMethodCall(MethodCallExpression node)
{
switch (node.Method.Name)
{
case "ElementAt":
return VisitElementAt(node);
case "get_Item":
return VisitGetItem(node);
}
return null;
} Is this a driver bug?