Is there a way to resolve ValidationAttribute.IsValid() asynchronously?

David Thielen 3,211 Reputation points
2023-04-15T18:24:39.3633333+00:00

Hi all; I have an IsValid() call that checks in registration to insure the user's email is not already in our user DB. To do so I need to query the database which is an async call. Is there any way to return a Task from IsValid or some other way return immediately and then later, when the query completes, then tell Blazor if the value is valid? thanks - dave

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,672 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.