src/openSourceC.DotNetLibrary.Core/Extensions/AttributeExtensions.cs
/// <summary>
///		Gets value of the <see cref="T:DisplayAttribute"/> for the specified object.
/// </summary>
/// <param name="obj">The object.</param>
/// <returns>
///		The value of the <see cref="T:DisplayAttribute"/> for the specified object if it
///		exists; otherwise, <b>null</b>.
/// </returns>
Gets value of the  for the specified object.
Gets value of the for the specified object .
public static string? GetDisplay(this object obj)
		{
			return (
				obj.GetType().GetCustomAttributes(typeof(DisplayAttribute), true).SingleOrDefault() is DisplayAttribute attribute
				? attribute.Description
				: null
			);
		}
public static string ? GetDisplay ( this object obj ) { return ( obj . GetType ( ) . GetCustomAttributes ( typeof ( DisplayAttribute ) , true ) . SingleOrDefault ( ) is DisplayAttribute attribute ? attribute . Description : null ) ; }
Gets value of the  for the specified object.
Gets value of the for the specified object .
The value of the  for the specified object if it
exists; otherwise, null
The value of the for the specified object if it exists ; otherwise null
object
this
obj
None