using reflection is better than try-catch, so this is the function I use:
public static bool doesPropertyExist(dynamic obj, string property) { return ((Type)obj.GetType()).GetProperties().Where(p => p.Name.Equals(property)).Any(); }
then ..
if (doesPropertyExist(myDynamicObject, "myProperty")){
Chtiwi malek
source share