I\'m implementing a general purpose function to extract a value from an arbitrary provided dynamic object, but don\'t know how to call TryGetMember
because it r
You don't call TryGetMember directly, what you need is to use the dynamic api's directly to get the same effect by using a csharp member binder and a call site.
This is made even easier by open source framework Dynamitey (via nuget) as it has a static method that does this. It works for any IDynamicMetaObjectProvider not just DynamicObject and (it works for regular types faster than reflection too).
return Dynamic.InvokeGet(Source, FieldName);