Introduction
Learn how to use a class that implements IDisplayMetadataProvider to transform property names such as FirstName to First Name.
Example for an HTML table
Using the provided class is not a replacement for using the Display attribute; instead, it is an option to consider.
Example class using the Display attribute
public partial class Person
{
public int PersonId { get; set; }
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Display(Name = "Last Name")]
public string LastName { get; set; }
[Display(Name = "Email Address")]
public string EmailAddress { get; set; }
}
Example class using the the custom provider
public partial class Person
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
}
Using PascalCaseDisplayMetadataProvider
More to follow
Will be creating more articles on this topic soon.
SOCIAL SHARE CARD GENERATOR