在 windows phone 中,我在数据库中检索了一个表作为 LINQ 中的字典。我的字典是这样的
Dictionary<int, StudentTable>
我从 LINQ 检索表为
var studentDictionary = studContext.StudentList.Select(p => new { p.RollNo, p }).AsEnumerable().ToDictionary(kvp => kvp.RollNo, kvp => kvp);
但我想将 studentDictionary 中的所有值作为
List<StudentTable>
我知道可以通过使用 for 循环将每个字典值添加到列表中。我怎么能在没有循环的情况下做到这一点。? 除了循环还有其他更好的方法吗?
谢谢