可以做到这一点,您只是语法有些错误。您需要
where为每个约束而不是用逗号分隔约束:
public TResponse Call<TResponse, TRequest>(TRequest request) where TRequest : MyClass where TResponse : MyOtherClass

可以做到这一点,您只是语法有些错误。您需要
where为每个约束而不是用逗号分隔约束:
public TResponse Call<TResponse, TRequest>(TRequest request) where TRequest : MyClass where TResponse : MyOtherClass