EF Core 11 code example with FullJoin, MinBy, MaxBy and GroupBy
EF Core 11 has some exciting new features such as FullJoin, MinBy and MaxBy support. It also has better GroupBy support and SQL improvements for split queries. You can learn more about what's new in EF Core 11, or watch the video.
Download the code example
You'll need to fill out the code example form. We will send you an email where you can download the code example.
Software
This is the software that will need to be installed onto your machine.
Visual Studio 2026. Version 18.12.0 or above. It will work with the free community version.
.NET 11 SDK. Version 11.0.0 or above.
Import the database
This application integrates with a SQL Server database. Inside the Database folder, there is RoundTheCode_EfCore11.bacpac and RoundTheCode_EfCore11.bak. Use either of these database backups to import the database to your local SQL Server database server.
The application
Inside Application/Web/Api/appsettings.Development.json, find ConnectionStrings:EfCore11DbContext and point the connection string to your imported database.
Open up RoundTheCode.EfCore11.slnx, and run the application. The Swagger documentation will load at https://localhost:7201/swagger with these endpoints:
/api/blogs/most-posts- AnMaxByAsyncexample/api/blogs/fewest-posts- AnMinByAsyncexample/api/blogs/most-posts- AGroupByexample that now translated to SQL/api/blogs/split-query- AnAsSplitQueryexample which has better SQL/api/orders/full-join- AFullJoinexample
If you want to create and apply an EF Core migration in one step, delete the Application/Libraries/Infrastructure/Migrations folder and the database you imported.
Then in Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console. Ensure that Default project is set to Libraries\Infrastructure, and run this command:
Update-Database -Migration RenameOrderTotal -AddThis will create the migration script in Application/Libraries/Infrastructure/Migrations, and create your database with the migrations applied.
Download this code example
Enter your email and we'll send you a download link.
Related code examples
See a code example of how transactions are used in Entity Framework Core and how they can be committed and rolled back
Download a code example that includes a reusable PagedResults type and query extension, ideal for pagination in Entity Framework Core.
Download this code example
Enter your email and we'll send you a download link.