Skip to content

Updates to .NET 10#264

Merged
christiannagel merged 19 commits intomainfrom
upgrade-to-NET10
Mar 7, 2026
Merged

Updates to .NET 10#264
christiannagel merged 19 commits intomainfrom
upgrade-to-NET10

Conversation

@christiannagel
Copy link
Contributor

PR Classification

Major upgrade and feature addition: updates projects to .NET 10.0 and Bootstrap 5.3.3, introduces new distributed .NET Aspire sample solutions, and adds advanced EF Core sample projects.

PR Summary

This pull request upgrades sample projects to .NET 10.0 and Bootstrap 5.3.3, adds new distributed .NET Aspire solutions, and introduces advanced EF Core samples with modern C# features and improved developer tooling.

  • All .NET projects and EF Core samples updated to target .NET 10.0, with refactored startup code and package dependencies.
  • New distributed .NET Aspire solutions added, including AppHost, Web (Blazor), ApiService, and ServiceDefaults projects, with full configuration and Azure deployment support.
  • Bootstrap 5.3.3 CSS and JS files (including RTL, utilities, reboot, and source maps) added or updated for enhanced responsive and RTL support.
  • New advanced EF Core sample projects (AutoInclude, OwnsManyJSON, Seeding) introduced, demonstrating features like JSON mapping, shadow properties, query filters, and modern C# syntax.
  • Developer tooling and documentation files (dotnet-tools.json, launchSettings.json, plan.md, assessment.md, execution-log.md) added or updated for improved migration, debugging, and upgrade tracking.

Migrated `TemporalTableSample.csproj` to target .NET 9.0.
Upgraded NuGet packages to version 9.0.4 for
`Microsoft.EntityFrameworkCore`, `Microsoft.EntityFrameworkCore.Design`,
`Microsoft.EntityFrameworkCore.SqlServer`, and
`Microsoft.Extensions.Hosting` to ensure compatibility and
leverage new features.
Updated the `Book` class to use primary constructor syntax for property initialization. Modified the `BooksContext` class to utilize a primary constructor for passing `DbContextOptions`. Refactored `Program.cs` to implement `Host.CreateApplicationBuilder`, simplifying service configuration and enabling sensitive data logging for the database context.
The project file `InheritanceMappingWithConversion.csproj` has been updated to target .NET 9.0 instead of .NET 7.0. Additionally, the versions of several NuGet package references have been upgraded from version 7.x to version 9.0. This includes `Microsoft.EntityFrameworkCore`, `Microsoft.EntityFrameworkCore.SqlServer`, and `Microsoft.Extensions.Hosting`, which have all been updated to version 9.0.4.
- Updated `GamesContext` constructor to accept `DbContextOptions<GamesContext>`, removing the default constructor for better flexibility.
- Enhanced `MappingExtensions` methods to use concise syntax and handle null values, improving robustness.
- Removed retrieval of `IDbContextFactory<GamesContext>` in `Program.cs`, indicating a potential refactor.
- Simplified initialization of `Fields` in `MoveData` classes using array initializer syntax for better readability.
Updated the `AddDbContextFactory` method for better readability. Changed the `Fields` property in `MoveData` from an object initializer to an array initializer. Switched from `SingleAsync` to `FindAsync` for game data retrieval, adding error handling for missing games.
Introduced a new `Seeding` sample with classes for menu management, including `ColumnNames`, `MenuCard`, and `MenuItem`. Implemented configurations for these entities using `IEntityTypeConfiguration`. Added compiled query extensions for efficient database access. Updated `MenusContext` to define `DbSet` properties and applied configurations. Created a `Runner` class for database operations and added an `appsettings.json` for configuration. Updated project to target .NET 9.0 and organized the solution structure.
Updated the `dotnet-ef` tool version from `6.0.3` to `9.0.4`.
Modified the `commands` array to include the `dotnet-ef` command
and added a new `rollForward` property set to `false`.
- Updated project files to target .NET 9.0.
- Upgraded `Microsoft.EntityFrameworkCore` packages to version 9.0.4.
- Added `launchSettings.json` for WSL support.
- Introduced `LoadingRelatedData` namespace for better organization.
- Refactored class constructors to use new C# 9.0 syntax.
- Improved sample data generation methods for readability.
- Updated `Runner` class to enhance clarity and reduce redundancy.
- Refactored `Program.cs` to streamline application startup.
- Ensured `appsettings.json` preserves the newest version.
- Overall improvements for performance and maintainability.
- Updated `Program.cs` to call `await runner.EfficientUpdateAsync()`.
- Modified menu item retrieval query in `Runner.cs` to use `EF.Functions.Like` for better pattern matching.
- Introduced `EfficientUpdateAsync()` in `Runner` class to update menu item prices efficiently with logging.
- Existing method `UpdateRecordUntrackedAsync()` remains unchanged.
Introduces a new method `QueryJsonAsync` in the `Runner` class to query and display orders containing monitor products. Updates `Program.cs` to call this method after database and orders creation, enhancing the program's functionality.
Updated Program.cs to use AzureCliCredential in DEBUG mode for easier local development. Upgraded target framework to .NET 8 in ConsoleApp.csproj, including version and language updates. Changed BooksConnection string in appsettings.json to a new database. Removed ModuleInitializer from Book.cs. Added .NET 8.0 info in Demo.cs.
Updated multiple project files to upgrade NuGet package references from version 9.0.4 to 9.0.9. This affects packages such as Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Design, Microsoft.EntityFrameworkCore.Cosmos, Microsoft.EntityFrameworkCore.Proxies, Microsoft.Extensions.Hosting, and Microsoft.Extensions.Configuration.UserSecrets. The updates are consistent across projects, aiming to incorporate bug fixes, performance improvements, and new features available in the newer version.
Refactored Program.cs to use Host.CreateApplicationBuilder instead of Host.CreateDefaultBuilder and ConfigureServices. Moved configuration and service registration to builder.Services and builder.Configuration. Improved error handling for missing connection strings. Updated scope creation and service resolution to use async patterns and modern .NET best practices. Modernizes startup and DI code for maintainability and compatibility.
@christiannagel christiannagel merged commit 7baa9e6 into main Mar 7, 2026
1 of 2 checks passed
@christiannagel christiannagel deleted the upgrade-to-NET10 branch March 7, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant