Bookmark and Share BitCoin Donate: 1Kdd2Es6nHrxG1JFWAQYzX5hwiTXu9aBBA

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);
        }