public static bool TryGetName(this PropertyInfo property, out string name) { name = null; DisplayNameAttribute n = property.GetCustomAttribute <DisplayNameAttribute>(); if (n.Exists()) { name = n.Name; return(true); } return(false); }