Execute<MyValidator0>(someData0); // Does not work, any way to change it so I can call it like this?
Execute<MyValidator1, MyDataType>(someData1); // Works
void Execute<V, Arg>(Arg argument) where V:IValidator<Arg>, new()
{
var instance = new V();
instance.ValidateAndThrow(argument);
}
Execute<MyValidator0>(someData0); // Does not work, any way to change it so I can call it like this?
Execute<MyValidator1, MyDataType>(someData1); // Works
void Execute<V, Arg>(Arg argument) where V:IValidator<Arg>, new()
{
var instance = new V();
instance.ValidateAndThrow(argument);
}