Entity Framework

Entity Framework is a object-relational mapping (ORM) framework.

The advantages of using an ORM in the application is that it takes the security aspect away from the programmer. This means that the integration between application and database is likely to be more secure.

Available in .NET Framework and .NET Core, it integrates a .NET application with a database, with Microsoft SQL Server very well supported.

It has support for LINQ queries, change tracking, updates and schema migrations.

Previous versions of Entity Framework had support for "database-first". This is where you created the database, hook your application to that database and import the database structure into your .NET application.

However, latest versions of Entity Framework support "code-first". You build up your entities in your application and add them to a DbContext. Then, you can use EF Migrations to import the entities and properties to your database. The entities are translated into tables, and the properties are translated into columns.

How to Log Data Changes in Entity Framework Core Articles

Other Articles

Round The Code Using Hosted Services in ASP.NET Core to Create a “Most Viewed” Background Service Using ASP.NET Core's Hosted Service for background tasks. Initialising a new scope in IServiceProvider to use Entity Framework in Hosted Services. 17th July 2020
Create CRUD API Endpoints with ASP.NET Core & Entity Framework Create CRUD API Endpoints with ASP.NET Core & Entity Framework We use an ASP.NET Core API to create generic CRUD Endpoints. Using Entity Framework's DbContext & Migrations, as well as Reflection & Controllers. 13th July 2020
Round The Code Create a Small Blog in Blazor – Part 3 – Build Entity Framework Queries We create services, with methods that contain Entity Framework queries for our blog before adding the services to Dependency Injection. 8th June 2020
Round The Code Create a Small Blog in Blazor – Part 2 – Entity Framework Integration We set up our entities and DbContext to integrate Entity Framework into our Blazor Server app. We also create the SQL Server database required. 29th May 2020
Using Entity Framework in a Blazor Server Application Using Entity Framework in a Blazor Server Application Find out how to change Entity Framework's scope to Transient and how to create new service scopes to use Entity Framework in Blazor. 9th April 2020
Round The Code Using Reflection to Create a Dynamic OnModelCreating in Entity Framework Using System.Reflection to invoke static OnModelCreating methods, allowing Entity Framework models to be invoked dynamically. 24th March 2020
Round The Code Setting up your DbContext for Entity Framework in .NET Core How to set up a connection string, adding entities, setting up migrations and overriding any methods for your Entity Framework Core DbContext. 30th December 2019
Round The Code Entity Framework Migrations in .NET Core Learn about "Code-First" migrations and how to use the "Add-Migration" and "Update-Database" commands in NuGet Package Console. 14th December 2019
Round The Code Using LINQ expressions to build dynamic queries in Entity Framework Make use of LINQ expressions to produce a Lambda expression dynamically. Build an expression for Entity Framework with the following clauses: And, Or, Any 10th August 2019