'Convert' Dictionary into List<object>

前端 未结 9 1765
感情败类
感情败类 2021-02-20 16:12

I have a Dictionary dictionary1 and I need to convert it into a List where Data has the properties lab

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-20 16:50

    .NET already has a data type that does what Data would do: KeyValuePair. Dictionary already implements IEnumerable>, just cast to it.

    Dictionary blah = new Dictionary();
    IEnumerable> foo = blah;
    

提交回复
热议问题