We are going to look at how to Configure one to one relationships in entity framework. One to One Relationships can be configured using Data Annotations or Fluent API.
Required Attribute Fluent Api Tutorial Data annotation InverserProperty attribute used in circumstances where, there are multiple relationships between two entities. A relationship in the Entity Framework always has two end points. The each end must return a navigational property which maps to the other end of the relationship. you can read about it from the […]
Data Annotation Required attribute is used for generating NOT NULL columns. Entity framework Code First will create a NOT NULL column if it detects a property having Required attribute.
Data Annotations NotMapped attribute is applied on those properties, which you do not include (calculated fields like age, Total etc.) in the database
Data Annotations in Entity Framework Code First Allows us to specify the size of the column using the StringLength Attribute