【发布时间】:2009-12-08 23:30:09
【问题描述】:
我知道Passing a generic collection of objects to a method that requires a collection of the base type
我如何在没有 .Cast 的 .Net 2.0 中做到这一点???
它必须是引用相等,即列表的副本不会这样做。
要重新迭代 - 我无法返回 新 列表 - 它必须是相同的列表
【问题讨论】:
-
Cast
运算符无论如何都不能满足您的要求。它不保留参考身份。
标签: c# collections