c# 确定dynamic类型的数据对象是否存在某个属性
public static bool IsPropertyExist(dynamic data, string propertyname)
{
if (data is ExpandoObject)
return ((IDictionary<string, object>)data).ContainsKey(propertyname);
return data.GetType().GetProperty(propertyname) != null;
}