Entity Framework Core

Relationships & Navigation Properties in EF Core

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 »

Entity Framework Core Fluent API

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

Entity Framework Core Fluent API Read More »

Scroll to Top