You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've installed the latest version (v. 2.1.0) in a Blazor Server with .NET 7 and the FluentValidationValidator class doesn't have the "GetFailuresFromLastValidation" method.
This is all I got:
using System;using System.Linq;using System.Threading.Tasks;using FluentValidation;using FluentValidation.Internal;using FluentValidation.Results;using Microsoft.AspNetCore.Components;using Microsoft.AspNetCore.Components.Forms;namespace Blazored.FluentValidation;publicclassFluentValidationValidator:ComponentBase{[Inject]privateIServiceProviderServiceProvider{get;set;}[CascadingParameter]privateEditContext?CurrentEditContext{get;set;}[Parameter]publicIValidator?Validator{get;set;}[Parameter]publicboolDisableAssemblyScanning{get;set;}[Parameter]publicAction<ValidationStrategy<object>>?Options{get;set;}internalAction<ValidationStrategy<object>>?ValidateOptions{get;set;}publicboolValidate(Action<ValidationStrategy<object>>?options=null){if(CurrentEditContext==null){thrownew NullReferenceException("CurrentEditContext");}ValidateOptions=options;try{return CurrentEditContext.Validate();}finally{ValidateOptions=null;}}publicasyncTask<bool>ValidateAsync(Action<ValidationStrategy<object>>?options=null){if(CurrentEditContext==null){thrownew NullReferenceException("CurrentEditContext");}ValidateOptions=options;try{
CurrentEditContext.Validate();if(!CurrentEditContext.Properties.TryGetValue("AsyncValidationTask",outobject value)){thrownew InvalidOperationException("No pending ValidationResult found");}await(Task<ValidationResult>)value;return!CurrentEditContext.GetValidationMessages().Any();}finally{ValidateOptions=null;}}protectedoverridevoidOnInitialized(){if(CurrentEditContext==null){thrownew InvalidOperationException("FluentValidationValidator requires a cascading parameter of type EditContext. For example, you can use FluentValidationValidator inside an EditForm.");}
CurrentEditContext.AddFluentValidation(ServiceProvider, DisableAssemblyScanning, Validator,this);}}
Am I missing something?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I had the same issue in v2.1.0, I upgraded to v2.2.0, in this version the method is available. But I get the error:
when GetFailuresFromLastValidation() is called.
I use version 11.9.2 for the Fluentvalidation and FluentValidation.DependencyInjectionExtension (latest version at the time of writing this). Is this another bug in the library?
Good morning,
I've installed the latest version (v. 2.1.0) in a Blazor Server with .NET 7 and the FluentValidationValidator class doesn't have the "GetFailuresFromLastValidation" method.
This is all I got:
Am I missing something?
Thanks in advance!
The text was updated successfully, but these errors were encountered: