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…)
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…)
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…)
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…)
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…)
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…)
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…)
In this tutorial you will learn How to Install Entity Framework Core on your project.
(more…)
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…)
The jQuery Empty method - .empty() is used to remove all the contents and children of the element.
(more…)