[英]How to add TimeSpans together using LINQ when in a Dictionary collection
Is it possible to group up all equal keys in a Dictionary and add their corresponding TimeSpans together using LINQ? 是否可以将字典中的所有相等键组合在一起,并使用LINQ将相应的TimeSpans添加到一起?
Something like this (but this doesnt work) 像这样的东西(但这不起作用)
var p = myDictionaryStringTimeStamp.Sum(x => x.Value.Add(myTimeStamp);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.