fullstackhero/blazor-wasm-boilerplate

Web-api giving exception on clicking Dashboard in Blazor frontend

Sarmadjavediqbal opened this issue · 3 comments

Screenshot 2023-04-28 165925

Screenshot 2023-04-28 165800

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

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

Not sure, but it could be related to this:

jbogard/MediatR#701

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.