fullstackhero / blazor-wasm-boilerplate

Clean Architecture Boilerplate Template for .NET 6.0 Blazor WebAssembly built for FSH WebAPI with the goodness of MudBlazor Components.
https://fullstackhero.net/blazor-webassembly-boilerplate/general/getting-started/
MIT License
529 stars 324 forks source link

Web-api giving exception on clicking Dashboard in Blazor frontend #265

Closed Sarmadjavediqbal closed 1 year ago

Sarmadjavediqbal commented 1 year ago

Screenshot 2023-04-28 165925

Screenshot 2023-04-28 165800

Web-api is throwing exception after clicking Dashboard in frontend (blazor-wasm).

Sarmadjavediqbal commented 1 year ago

any solutions??? s’il vous plaît

MikaelHild commented 1 year ago

Not sure, but it could be related to this:

https://github.com/jbogard/MediatR/issues/701

Sarmadjavediqbal commented 1 year ago

I found the solution. The definition of the Interface (IPipelineBehavior<TRequest, TResponse>) is:

Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next);

where as the class ValidationBehavior was implementing the above definition in wrong sequence as below:

Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken)

The definitions in both lines look the same but work differently. So I switched these two and it works just fine. Thanks @MikaelHild again for guiding.

It took a while but a little focus on the little details can save you hours of research.