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;
}
本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/8135579.htmlX,如需转载请自行联系原作者