Skip to content

Support async validation in minimal APIs #64609

Closed

Description

@captainsafia

We should react to dotnet/runtime#121536 one the APIs to support async validation are supported.

Activity

  1. added this to the .NET 11 Planning milestone on Dec 2, 2025
  2. added
    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
    feature-validationIssues related to model validation in minimal and controller-based APIs
    on Dec 2, 2025
  3. danroth27 commented on Feb 10, 2026

    @danroth27
    Member

    @SamMonoRT I assume this should go to @halter73 at this point.

  4. Digvijay commented on Mar 11, 2026

    @Digvijay

    I've been exploring this space with an experimental, open-source validation source generator called Sannr. It's not a competitor to Microsoft.Extensions.Validation — it's a personal research project building in the open.

    Async validation is supported today in Sannr:

    public partial class UserRegistration
    {
        [CustomValidator(typeof(UserRules), nameof(UserRules.IsUniqueAsync), IsAsync = true)]
        public string Email { get; set; }
    }
    
    public static class UserRules
    {
        public static async Task<ValidationResult> IsUniqueAsync(string email, IServiceProvider sp)
        {
            var db = sp.GetRequiredService<AppDbContext>();
            bool exists = await db.Users.AnyAsync(u => u.Email == email);
            return exists 
                ? ValidationResult.Error("Email is already taken.") 
                : ValidationResult.Success();
        }
    }
  5. Youssef1313 commented on Apr 27, 2026

    @Youssef1313
    Member
  6. self-assigned this
    on May 30, 2026
  7. CoreDX9 commented on Jul 23, 2026

    @CoreDX9

    Is MVC support included in the plan?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-validationIssues related to model validation in minimal and controller-based APIson-roadmapListed on the current release roadmap

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions