I have an anonymous type object that I receive as a dynamic from a method I would like to check in a property exists on that object.
.... var settings = new
This is working for me-:
public static bool IsPropertyExist(dynamic dynamicObj, string property) { try { var value=dynamicObj[property].Value; return true; } catch (RuntimeBinderException) { return false; } }