首页 > 解决方案 > 实现接口 B 的接口 D 的列表不能被识别为 List

问题描述

标签: c#

解决方案


您可以为 IB 创建通用方法和限制类型:

void ProcessListOfIB<T>(List<T> list) where T:IB
{
    // Some code
}

推荐阅读