The year 2022 has officially started and Microsoft has already started making their plans clear for the year. These plans will come to fruition in mid to late November of this year. We are speaking about EF 7, or Entity Framework Core 7, and .NET 7. For this article, we will concentrate specifically on EF 7.
What Features Will Be in Entity Framework Core 7?
Features that might be in EF 7’s future pipeline include:
- Bulk updates
- Database scaffolding
- Raw SQL queries for unmatched types
- TPC (table-per-concrete-type) mapping
- Lifecycle hooks
- Value objects
- JSON columns
- Map CUD operators to SPs (stored procedures)
- EF Core tooling
- EF Core and GUIs
Some more information about these features follows below.
Read: Using the Entity Framework Core with SQLite
Bulk updates for EF 7
SaveChanges, along with Change tracking requires that a database round trip be made to load all the entities into memory, then another to execute the saving commands. With EF 7, changes are proposed to be made to the SaveChanges method to be able to do bulk updates and deletions.
Database Scaffolding
Microsoft plans to enable code customization for the code generated by the database ef database scaffold command. They plan to do this via the use of T4 templates. A T4 text template – or pre-processed template – is a combination of text blocks and control logic that can generate a text file. The logic is written as fragments of program code.
Raw SQL Queries for Unmatched Types
With Entity Framework 7, raw SQL queries might be able to return types not contained in the EF 7 model directly.
Read: Using RAW Queries in Entity Framework
Lifecycle Hooks
In EF 7, missing life-cycle hooks will be added to further enhance notifications when conditions occur for entities, properties, queries, and relationships.
Value Objects
Entity Framework 7 will offer a better experience, specifically focused on the needs of value objects in DDD (domain-driven-design>.
JSON Columns
According to Microsoft, EF 7 plans to introduce JSON patterns that can be implemented by any database provider.
Map CUD Operators to Stored Procedures
Entity Framework 7 will be able to map the insert, update, and delete operations that are generated by SaveChanges to stored procedures.
EF Core Tooling, EF Core, and Graphical User Interfaces (GUIs)
Microsoft plans to update the EF tooling architecture to support newer platforms better. They also intend to make improvements to experiences related ti Windows Forms and .Net Maui as they relate to Entity Framework 7.
Additional Entity Framework 7 and .NET Changes
There are a lot of new things heading our way from Microsoft, Entity Framework 7, and .NET, so let us wait and see what the tech juggernaut brings later this year! Be sure to check back on CodeGuru often to see what new features and changes are announced.