I’d like to be able to do something like the following:
dynamic a = new ExpandoObject();
Console.WriteLine(a.SomeProperty ?? "No such member");
but that throws
RunTimeBinderException: 'System.Dynamic.ExpandoObject' does not contain a definition for 'Throw'
Do you know of an implementation of DynamicObject that would return null for missing definitions, or a tutorial on how to create one? Many thanks!
Something like this?
I expect the real
ExpandoObjectis rather more sophisticated than this, but if this is all you need…