Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get to Know EF Core 6

#1
Get to Know EF Core 6

Jeremy

The Entity Framework Core team has released the generally available version of EF Core 6.0 in parallel with .NET 6. EF Core 6 is available as a set of NuGet Packages. At the end of this blog post you will find a packages section that lists all of the available packages and describes what they are used for.

EF Core 6.0 is a modern, cloud-native-friendly data access API that supports multiple backends. Get up and running with a document-based Azure Cosmos DB container using only a few lines of code, or use your LINQ query skills to extract the data you need from relational databases like SQL Server, MySQL, and PostgreSQL. EF Core is a cross-platform solution that runs on mobile devices, works with data-binding in client WinForms and WPF apps “out of the box”, and can even run inside your browser!

Did you know it is possible to embed a SQLite database in a web app and use Blazor WebAssembly to access it using EF Core? Check out Steven Sanderson’s excellent video to see how this is possible. Combined with the power of .NET 6, EF Core 6.0 delivers major performance improvements and even scored 92% better on the industry standard Tech Empower Fortunes benchmark compared to EF Core 5.0 running on .NET 5. The EF Core team and global OSS community have built and published many resources to help you get started.

This blog post lists a few ways to learn about new features and get up and running with Entity Framework Core as quickly as possible.

The first step in your journey should always be the comprehensive documentation available online at https://docs.microsoft.com/ef. There you will find everything from a step-by-step guide to build your first EF Core app to a comprehensive list of what’s new in EF Core 6. If you find anything missing, let us know via GitHub issues and/or submit a pull request.

Note: various samples ready to build and run are available on GitHub at: What’s New in EF Core 6 Samples.

Check out our EF Core Community Standup EF Core 6.0 retrospective to hear from the team and several community members about the release. We also presented What’s New with EF Core 6.0 at .NET Conf 2021. Be sure to check out community member Julie Lerman’s comprehensive article EF Core 6: Fulfilling the Bucket List.

For excellent advice regarding updating your existing apps, read Updating your ASP.NET Core and/or EF Core Application to .NET 6.

Get to Know EF Core 6.0


The following major areas were added or improved in EF Core 6.0, and each has several resources to help you get started.

Azure Cosmos DB


The EF Core team invested heavily to ensure that working with Azure Cosmos DB is a first class experience. From simplifying configuration to supporting raw SQL and delivering diagnostics, we believe this is a full featured option for working with the popular NoSQL database.

Compiled Models


EF Core parses configuration information to build a working model of how the domain maps to the underlying database. The time it takes to compile the memory increases as the number of entities, properties, and relationships grows. Customers with apps in distributed environments or using platforms like Azure Functions require fast startup times. Compiled models addresses this by building the model at development time, significantly improve the time to first query result.

Configure Conventions


Imagine you want to impose a string column length limit of 200 characters on every table in your database. If you have hundreds of entities, this would require either applying data annotations or performing fluent configuration for every table. Pre-configuration conventions allow you to specify a rule as a convention that becomes the default unless you opt-out. This can potentially save hundreds of lines of code and allows you to make changes in a single place.

Migration Bundles


A popular feature of EF Core is the ability to track schema changes by version for your database. This capability is called migrations. Traditionally, migrations are embedded in your target application. They would require you to deploy the app along with the .NET SDKs and runtime to execute. To simplify this step as a part of continuous deployment, the EF Core team built migration bundles. These are self-contained, standalone executables that apply the migrations as part of your CI/CD pipeline.

Performance


The team’s aggressive focus on performance resulted in a 92% improvement for the full stack of EF Core 6 on .NET 6 over EF Core 5 on .NET 5 according to the industry standard TechEmpower benchmark.

Temporal Tables


SQL Server supports temporal tables. This is an audit mechanism that tracks every change to a database table and exposes it in a queryable format. EF Core recently added first class support to create, query, and even restore entries from temporal tables.

GraphQL


The team focused on the GraphQL experience and although there aren’t specific changes in EF Core 6.0 related to GraphQL, here are some resources that show how well the two technologies work together.

Packages


The EF Core packages for EF Core 6 include:

We have also published the 6.0.0 release of the Microsoft.Data.Sqlite.Core ADO.NET provider.

Installing dotnet ef


To execute EF Core migration or scaffolding commands, you’ll have to install the EF Tools package as either a global or local tool.

EF Tool

If you already installed a previous version of the tool, update it with

dotnet tool update --global dotnet-ef

If this is your first time installing the tool, use:

dotnet tool install --global dotnet-ef

It’s possible to use this new version of dotnet ef with projects that use older versions of the EF Core runtime. For more information on the tool, read: Get the Entity Framwork Core Tools.

Conclusion


Speed. Performance. Improved capabilities across the board. This version of EF Core 6.0 is optimized to work on your platform of choice and connect to your database of choice. Accelerate your development and speed up your performance and make the move to EF Core 6.0!



https://www.sickgaming.net/blog/2021/11/...ef-core-6/
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

[-]
Discord

[-]
Active Threads
News - Video: We Have A Lot Of Feelings ...
Last Post: xSicKxBot
Yesterday 11:53 PM
» Replies: 0
» Views: 12
News - Iconic Rockstar And Actor Meat Lo...
Last Post: xSicKxBot
Yesterday 11:53 PM
» Replies: 0
» Views: 1
(Indie Deal) FREE Last Horizon, Microids...
Last Post: xSicKxBot
Yesterday 08:25 PM
» Replies: 0
» Views: 10
Microsoft - Celebrating 20 years of Trus...
Last Post: xSicKxBot
Yesterday 08:25 PM
» Replies: 0
» Views: 3
Xbox Wire - New EA Play Member Rewards F...
Last Post: xSicKxBot
Yesterday 08:25 PM
» Replies: 0
» Views: 3
News - PS5 Will Outsell Series X|S 2:1 I...
Last Post: xSicKxBot
Yesterday 08:25 PM
» Replies: 0
» Views: 3
[Tut] Pandas get_dummies() – A Simple Gu...
Last Post: xSicKxBot
Yesterday 04:18 PM
» Replies: 0
» Views: 19
Mobile - Genshin Impact’s Tomo – vision,...
Last Post: xSicKxBot
Yesterday 04:18 PM
» Replies: 0
» Views: 5
News - Community Focus: Parris
Last Post: xSicKxBot
Yesterday 04:18 PM
» Replies: 0
» Views: 8
News - Bedrock: BETA 1.18.10.28
Last Post: xSicKxBot
Yesterday 04:18 PM
» Replies: 0
» Views: 6

[-]
Twitter



Discord Server © SickGaming.net 2012-2021