Mediatr: error CS0305: Using the generic type 'ValidationContext<T>' requires 1 type arguments

Created on 12 Jul 2020  路  1Comment  路  Source: jbogard/MediatR

when using ValidationBehavior class cause an error
because of below code
var context = new ValidationContext(request);

Most helpful comment

Hi, I think you are using FluentApi 9.0 and code that you pasted is from 8.0 there was some changes try using
var context = new ValidationContext<TRequest>(request);
it worked for me, good luck

>All comments

Hi, I think you are using FluentApi 9.0 and code that you pasted is from 8.0 there was some changes try using
var context = new ValidationContext<TRequest>(request);
it worked for me, good luck

Was this page helpful?
0 / 5 - 0 ratings