PdfRpt.Core.Helper.PropertyDataAnnotations.GetColumnPropertyNameAttribute C# (CSharp) Method

GetColumnPropertyNameAttribute() public static method

Returns PdfRptColumnPropertyNameAttribute data. Processing order is checking PdfRptColumnPropertyNameAttribute first, then DisplayNameAttribute and finally DescriptionAttribute. If none of these is available, the actual property name will be returned.
public static GetColumnPropertyNameAttribute ( this info ) : string
info this Property metadata info
return string
        public static string GetColumnPropertyNameAttribute(this MemberInfo info)
        {
            var columnPropertyName = info.GetCustomAttributes(true).OfType<PropertyNameAttribute>().FirstOrDefault();
            if (columnPropertyName != null) return columnPropertyName.PropertyName;

            var displayName = info.GetCustomAttributes(true).OfType<DisplayNameAttribute>().FirstOrDefault();
            if (displayName != null) return displayName.DisplayName;

            var description = info.GetCustomAttributes(true).OfType<DescriptionAttribute>().FirstOrDefault();
            if (description != null) return description.Description;

            return null;
        }