一个IEnumerable接口问题

曾经在程序中为一个Combobox的类的DataSource属性赋值了一个IEnumerable<T>.Select()方法的返回值,结果在.net40中运行良好,但是.net4.5中就报错误,异常信息是

System.NotImplementedException: The method or operation is not implemented.

所以微软又给上了一课,接口之后一定要ToList,不然他也不能保证在不同的.Net版本中得到相同的结果。

 

posted @ 2015-02-05 10:27  雨中的阳光  阅读(147)  评论(0编辑  收藏  举报