[CSHARP-1085] BsonSerializationInfoFinder VisitMethodCall Created: 10/Oct/14  Updated: 07/May/15  Resolved: 07/May/15

Status: Closed
Project: C# Driver
Component/s: BSON, Linq, Serialization
Affects Version/s: 1.9.2
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dama Reffett Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

N/A


Backwards Compatibility: Fully Compatible

 Description   

BsonSerializationInfoFinder VisitMethodCall doesn't address the method GetValue case.

I'm currently developing dynamic linq, where I leverage the GetValue to build a method then create an expression with it. Suggested update to the VisitMethodCall,

protected override BsonSerializationInfo VisitMethodCall(MethodCallExpression node)
{
switch (node.Method.Name)

{ case "ElementAt": return VisitElementAt(node); case "GetValue": case "get_Item": return VisitGetItem(node); }

return null;
}

It works like a champ now.

Thanks,
Dama



 Comments   
Comment by Craig Wilson [ 04/Apr/15 ]

What type does GetValue live on? If we are going to support it, I'd like to make sure it is accurate always.

Generated at Wed Feb 07 21:38:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.