更新时间:2023-02-01 09:35:59
一个简单的了ToList()
您的结果var目录应该工作。
A simple ToList()
on your result var should work.
修改:
由于BornTo code为修正的解释
Edit: Thanks to BornToCode for a corrected explanation
的原因的错误是在数据源应该实现的ICollection。 IEnumerable的不,当你做了ToList()将它转换成一个实现ICollection的列表
The reason for the error is that the data source should implement ICollection. IEnumerable does not, when you do ToList() it converts it into a list which implements ICollection