Tutorials on ASP.NET Core, Blazor, jQuery, JavaScript, Entity Framework, Identity, WordPress, SQL, HTML & more


Update Records in Entity Framework Core

Last Updated: February 7, 2025

update records ef core

The Entity Framework Core executes UPDATE statement in the database for the entities whose EntityState is Modified. The DbContext's Update() update method is used for performing the updation of records in the database.

(more…)

Read Records in Entity Framework Core

Last Updated: April 19, 2025

read records ef core

Entity Framework Core Reads Record from the database through the DbContext object. For example we can get all records from the database by using the below code.

var emp = context.Employee;

Here "context" is the object of DbContext class and "employee" is the entity whose reacords Entity Framework Core is reading from the database.

We can also fetch a particular employee from database. For example in the below code we are fetching the employee with name as Matt.

var emp = await context.Employee.Where(e => e.Name == "Matt").FirstOrDefaultAsync();
(more…)

Insert Records in Entity Framework Core

Last Updated: February 7, 2025

insert records ef core

In this tutorial we will learn to Insert Records in Database with Entity Framework Core. EF Core can insert a single record or bulk records at the same time. Note that entities that have EntityState value as 'Added' are insterted to the database.

(more…)

Migrations in Entity Framework Core

Last Updated: February 7, 2025

migrations ef core

Entity Framework Core Migrations keep the database synchronized with the domain entity classes and configurations given on DbContext. Migrations will create or update the database in a very easy manner. When a project in under development, the programmers keep on updating the entity classes, therefore they need to run migrations inorder to keep the database schema up to date.

(more…)

Code-First Approach in Entity Framework Core

Last Updated: February 7, 2025

code first approach ef core

The Entity Framework Core Code-First approach creates the database and tables based on entity classes and configurations given on DbContext. The Code-First Approach is helpful in situations where we are beginning a new project and don’t have a clear picture of the database. This is the preferred approach when working with EF Core and the creation of database & tables are done when migration commands are run.

(more…)

DbContext Class in Entity Framework Core

Last Updated: February 7, 2025

dbcontext class

Entity Framework Core Database Context is an important class which is used to maintain session with the database. It thus help in performing all types database operations like creating, reading, updating and deleting records. We create a database context for the app by inheriting a class from the DbContext class of the Microsoft.EntityFrameworkCore namespace.

(more…)

Database-First approach in Entity Framework Core

Last Updated: February 7, 2025

database first approach

In Database-First approach the entity and context classes are automatically created by the EF Core from the database. So this means you have to first create your database for the app.

(more…)

Installation of Entity Framework Core

Last Updated: February 7, 2025

install entity framework core

In this tutorial you will learn How to Install Entity Framework Core on your project.

(more…)

Introduction to Entity Framework Core

Last Updated: February 7, 2025

introduction entity framework core

Entity Framework Core also known as EF Core is the latest version of Microsoft’s Entity Framework. It is an Object Relational Mapping (O/RM) framework, an enhanced version of ADO.NET, that automates data storage and retrieval from the database. EF Core is open source, cross-platform, lightweight, extensible and very powerful in nature. It is also very easy to learn and use in our DOT NET Projects.

(more…)

How to use jQuery Empty Method – .empty()

Last Updated: June 3, 2021

jquery empty

The jQuery Empty method - .empty() is used to remove all the contents and children of the element.

(more…)