Data Annotations

Data Annotation NotMapped Attribute in Entity Framework
Entity Framework

NotMapped Attribute Entity Framework

Apply the NotMapped attribute on those properties, which you do not want to include in your database table. This attribute usually used in the case of calculated fields like Age, Amount, etc. This attribute is available both in Entity Framework & Entity Framework Core

Data Annotations MaxLength and MinLength Attribute
Entity Framework

MaxLength/MinLength Attribute in Entity Framework

The MaxLength Attribute and MinLength Allow us to specify the size of the column. Both these attributes are available in System.ComponentModel.DataAnnotations library. These attributes are similar to StringLength Attribute. Both of these attributes are available in EF 6 & EF Core.

Scroll to Top