I have List where MyType : DynamicObject. The reason for MyType inheriting from DynamicObject, is that I need a type that can contain unknown number of properties.
It all works fine until I need to filter List. Is there a way I can do a linq that will do something like this:
return all items where any of the properties is empty string or white space?
Well as long as each object’s properties are not unknown internally to themselves you could do it.
There isn’t a great generic way to test all the properties of a dynamic object, if you don’t have control over the
DynamicObjectyou hope the implementer implementedGetDynamicMemberNames()and you can use the nuget package ImpromptuInterface’s methods for getting the property names and dynamically invoking those names.Otherwise, since it’s your own type
MyTypeyou can add your own method that can see internal accounting for those member values.