public static string GetFormat(this ICustomAttributeProvider member) { return member.GetCustomAttributes(typeof(DisplayFormatAttribute), false) .OfType<DisplayFormatAttribute>() .Select(attribute => attribute.DataFormatString) .LastOrDefault(); }