泛型方法中的Where子句

Leo*_*rdo -1 c# generics

我有一个泛型方法,需要2个泛型参数:BType和IType.有没有办法在方法签名中定义BType必须是IType的实现?!?

Edit1:这里的方法签名:

public static Expression<Func<BType, bool>> CastFunc<BType,IType>(Expression<Func<IType, bool>> customWhereClause)
Run Code Online (Sandbox Code Playgroud)

Aro*_*ron 10

public void Foo<BType, IType>(BType a, IType b) where BType : IType
Run Code Online (Sandbox Code Playgroud)