-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
See #35602 (comment)
Move this new .NET 10 release note information into dotnet/aspnetcore.docs articles where needed:
https://raw.githubusercontent.com/dotnet/AspNetCore.Docs/refs/heads/main/aspnetcore/release-notes/aspnetcore-10/includes/validation-package-move.md
[Extended instructions provided by wadepickett to help copilot make a draft, AI assisted:]
Solution for Issue #35744
Implementation Plan
- Create the include file above at
/aspnetcore/includes/validation-package-net10.mdwhich should have something similar to the following markdown:
Start markdown for aspnetcore/includes/validation-package-net10.md
Validation in .NET 10
In .NET 10, the unified validation APIs have been moved to the Microsoft.Extensions.Validation NuGet package. This change makes the validation APIs available outside of ASP.NET Core HTTP scenarios.
To use the Microsoft.Extensions.Validation APIs:
-
Add the following package reference:
<PackageReference Include="Microsoft.Extensions.Validation" Version="10.0.0" />
The functionality remains the same but now requires an explicit package reference.
-
Register validation services with dependency injection:
builder.Services.AddValidation();End markdown for aspnetcore/includes/validation-package-net10.md
The key files to update with the `/aspnetcore/includes/validation-package-net10.md` include are:
- `/aspnetcore/mvc/models/validation.md` (main validation documentation)
- `/aspnetcore/tutorials/first-mvc-app/validation.md` (using moniker range for .NET 10)
- `/aspnetcore/tutorials/razor-pages/validation.md` (using moniker range for .NET 10)
3. For moniker-based documentation, add a section like:
```markdown
:::moniker range=">= aspnetcore-10.0"
[!INCLUDE[](~/includes/validation-package-net10.md)]
:::