我必须转换 System.Collections.Generic.IDictionary<string, decimal>
至 System.Collections.Generic.Dictionary<string, decimal>
,我不能。我尝试了 ToDictionary 方法,但无法指定正确的参数。
我试过以下方法:
// my dictionary is PlannedSurfaces (of type IDictionary<string, decimal>)
blabla.ToDictionary<string, decimal>(localConstruction.PlannedSurfaces)
最佳答案
var newDict = new Dictionary<string, decimal>(oldDictionary)
关于c# - 将 IDictionary 转换为字典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6422091/