Execute Raw SQL Queries using FromSql() method in Entity Framework Core

Last Updated: November 10, 2018

execute sql queries ef core

Entity Framework Core has a powerful method known as .FromSql() which is used to Execute Raw SQL Queries including Parameterized Queries. This method returns an entity object. (more…)

Configure Many-to-Many relationship using Fluent API in Entity Framework Core

Last Updated: November 7, 2018

fluent api many to many ef core

Lets configure Many-to-Many Relationship using Fluent API. Note that there are no default conventions in Entity Framework Core to automatically configure a many-to-many relationship. Therefore you must configure it using Fluent API. (more…)

Configure One-to-One relationship using Fluent API in Entity Framework Core

Last Updated: November 2, 2018

fluent api one to one ef core

Here you will learn how to configure One-to-One relationship using Fluent API. But generally speaking, you don’t need Fluent API to do this as the EF Core Conventions will automatically create the One-to-One relationship between entities. (more…)

Configure One-to-Many relationship using Fluent API in Entity Framework Core

Last Updated: October 30, 2018

fluent api one to many relationship

Entity Framework Core makes it very easy for us to configure relationships using Fluent API. In this tutorial I will explain how to configure One-to-Many relationship using Fluent API. (more…)

Fluent API in Entity Framework Core

Last Updated: October 27, 2018

fluent api ef core

You can override the default conventions of Entity Framework Core using Fluent API. By using it, you can configure many different things, as it provides more configuration options than Data Annotation Attributes. Also, Fluent API configurations have higher precedence than data annotation attributes. (more…)

Configurations in Entity Framework Core

Last Updated: October 23, 2018

configurations ef core

In the previous tutorial I explained the Conventions in EF Core. If you want to override the conventions then apply the configurations and customize the EF model to database mappings. (more…)

Conventions in Entity Framework Core

Last Updated: October 20, 2018

conventions ef core

Conventions in Entity Framework core are the default rules by which the Database schemas are created based on domain and context classes. (more…)

Delete Records in Entity Framework Core

Last Updated: October 15, 2018

delete records ef core

EF Core API builds and executes the DELETE statement in the database for the entities whose EntityState is set as ‘Deleted’. The method DbContext.Remove() is used for deleting entity. (more…)

Update Records in Entity Framework Core

Last Updated: October 13, 2018

update records ef core

The Entity Framework Core executes UPDATE statement in the database for the entities whose EntityState is Modified. The DbContext tracks of all entities and those that are modified it sets there EntityState as modified. (more…)

Read Records in Entity Framework Core

Last Updated: November 27, 2018

read records ef core

Reading data from database in Entity Framework Core is quite easy. The below code will load the employee with name ‘Matt’. (more…)