Skip to content

20 Data Anotations

René Pacios edited this page Jun 11, 2018 · 1 revision

Title columns used to more complex that Number, Name or ADate and might not match with our properties name conventions. In this case can use DataAnnotations to pair column with object field.

For example, next Excel shows a new column with title Birthday date

We pair with field using standard DisplayName Annotation

  public class SimpleTable
    {
        public int Number { get; set; } 

        public string Name { get; set; }

        [DisplayName("Birthday date")]
        public DateTime ADate { get; set; }

    }

Clone this wiki locally