I’m writing an application in Blazor and I’m using then FluentValidation package. I’m trying to have a waiting popup during the async validation process without any success.
Regards
Al
RuleFor(r => r.OriginalOrder)
.NotEmpty()
.WithMessage(loc[nameof(Resources.Orders.ExistingOriginalOrderNumberRequired)])
.MustAsync(async (originalOrder, cancellation) =>
{
ShowSpinner()
try
{
var result = await wsRequester.GetReturnAsync(...)
if (result.RequestResult == WSRequester.RequestResult.Success)
{
return result.DTOReturn.Any();
}
return false;
}
finally
{
HideSpinner()
}
}).WithMessage(loc[nameof(Resources.Orders.ExistingOriginalOrderNumberRequired)]);