我有一个泛型方法,需要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)
| 归档时间: |
|
| 查看次数: |
802 次 |
| 最近记录: |