public static PropertyExists ( this type, string propertyName ) : bool | ||
type | this | |
propertyName | string | |
return | bool |
public static bool PropertyExists(this Type type, string propertyName)
{
if (type == null || propertyName == null)
{
return false;
}
return type.GetProperty(propertyName) != null;
}