Data Annotations

InverseProperty Attribute Entity Framework Code First
Entity Framework Core

InverseProperty Attribute in EF Core

The InverseProperty informs the EF Core, which navigational property it relates to on the other end of the relationship. The default convention in EF Core correctly identifies only if there is a single relation between two entities. But in the case of multiple relationships, it fails to correctly identify them. In such cases, we use the InverseProperty to help the EF core correctly identify the relationship.

Data Annotations MaxLength and MinLength Attribute
Entity Framework Core

MaxLength/MinLength Attribute in EF Core

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