Bookmark and Share BitCoin Donate: 13t8gAWVpHP2ddxMp88d1NFpZjnFJC6UwK

Check if a property exists on a dynamic property with the ExpandoObject in dotnet

A dynamic object or ExpandoObject implements a dictionary so it's very easy to see if a property exists:

        private static bool propertyExists(dynamic Dynamique, string Property)
        {
            IDictionary properties = (IDictionary)Dynamique;
            return properties.ContainsKey(Property);
        }