为了账号安全,请及时绑定邮箱和手机立即绑定

如何循环 Dictionary<IEnumerable<string>

如何循环 Dictionary<IEnumerable<string>

C#
拉莫斯之舞 2021-08-07 16:37:46
班级:class myClass{    public int processId { get; set; }    public string measurement { get; set; }    public decimal measurementValue { get; set; }    public string otherText { get; set; }}代码:List<myClass> myClasses = new List<myClass> {    new myClass { processId=1, measurement="height", measurementValue=10,otherText="312312" },    new myClass { processId=1, measurement="length", measurementValue=11 ,otherText="312312"},    new myClass { processId=1, measurement="width", measurementValue=12 ,otherText="312312"},    new myClass { processId=2, measurement="height", measurementValue=20 ,otherText="312312"},    new myClass { processId=2, measurement="length", measurementValue=21 ,otherText="312312"},    new myClass { processId=2, measurement="width", measurementValue=22 ,otherText="312312"}};var groups = myClasses    .GroupBy(o => o.processId)    .ToDictionary(g => g.Select(x => x.measurement), g => g.Select(x => x.measurementValue));groups 是 Dictionary<IEnumerable<string>, Dictionary<IEnumerable<decimal>>如何为所有键和值循环分组?我没弄明白。foreach(var group in groups){    //????}
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 149 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信