Skip to content

[RC1] Update Blazor form validation docs for .NET 10 #35972

@oroztocil

Description

@oroztocil

Description

Suggestions for improvements of the Blazor form validation docs for .NET 10:

  • Document new features added in RC1

    • SkipValidation attribute
    • Support for type-level validation attributes (in addition to the already existing IValidatableObject support)
  • Document behavior of the DataAnnotationsValidator

    • After RC1 the new validation infrastructure and consequently the DataAnnotationsValidator component have the same behavior with regards to validation order and short-circuiting as System.ComponentModel.DataAnnotations.Validator
    • We could add a brief description of this logic so that user's are not surprised about the validation outcome when they have a combination of property-level and type-level validation rules
  • Remove information about ObjectGraphDataAnnotationsValidator

    • The docs for complex object validation contain a mixture of information describing both the new validation implementation and the deprecated ObjectGraphDataAnnotationsValidator from the unsupoorted NuGet package
    • We want to remove all mentions of the old package
    • Optionally, leave a short note stating that ObjectGraphDataAnnotationsValidator should not be used and point the users to the improved capabilities of the standard component
  • MOVED TO Server validation with a validator component upgrade #36051 Idea: Replace use of MVC controller with Minimal API in the section "Server validation with a validator component" to showcase the unified validation experience

    • The API controller uses MVC-based validation which also uses DataAnnotations attribute to specify validation rules. However, it is configured differently and might have different behavior in some cases (e.g. validation is skipped with ValidateNever attribute in MVC but with SkipValidation attribute in the unified validation code)
    • Up for debate: Speaking of "server validation" and "client validation" might also be a bit confusing in the context of Blazor Server - maybe rephrase the section using terminology such as "data API", "backend", or "backend API"?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/forms/validation?view=aspnetcore-10.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/forms/validation.md

Document ID

bcb470e1-c859-0549-b4ef-c6c9b7ef2c72

Platform Id

b4c1bad9-fc7a-21f5-2552-f0f3617f77db

Article author

@guardrex

Metadata

  • ID: bcb470e1-c859-0549-b4ef-c6c9b7ef2c72
  • PlatformId: b4c1bad9-fc7a-21f5-2552-f0f3617f77db
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions