One to One Relationship in Entity Framework Core
We are going to look at how to Configure one to one relationship in entity framework core using Convention, Data Annotations & Fluent API.
One to One Relationship in Entity Framework Core Read More »
We are going to look at how to Configure one to one relationship in entity framework core using Convention, Data Annotations & Fluent API.
One to One Relationship in Entity Framework Core Read More »
In relational databases, it is a healthy practice to divide the data between related tables. For Example, the employee working in a particular department. We do not store both the information in the same table but divide them into Employee & Department table. When we divide tables, we also need to specify the relationships between them. For example, if you are looking for an employee working in a particular department, then you need to specify the relationship between employees and the department table. The relationship between these tables is defined using the foreign keys. We then use these relationships to query the database to get the meaningful data.
Relationships & Navigation Properties in EF Core Read More »
The HasAlternateKey method creates the Unique constraint for the property in the database. The Primary Key already has Unique Constraint defined, but you can have only one Primary Key in the table. Unique Constraints ensures that no duplicate values are entered in the columns.
The Ignore method of the EF Core Fluent API is used to Ignore a Property or Entity from being mapped to the database
Fluent API in Entity Framework Core is a way to configure the model classes. Fluent API uses the Modelbuilder instance to configure the domain model. We can get the reference to the ModelBuilder, when we override the onmodelcreating method of the DbContext. The ModelBuilder has several methods, which you can use to configure the model. These methods are more flexible and provide developers with more power to configure the database than the EF Core conventions and data annotation attributes