I have to convert System.Collections.Generic.IDictionary<string, decimal> to System.Collections.Generic.Dictionary<string, decimal>, and i can't. I tried the ToDictionary method and can't specify right arguments. 
I've tried the following:
// my dictionary is PlannedSurfaces (of type IDictionary<string, decimal>)
blabla.ToDictionary<string, decimal>(localConstruction.PlannedSurfaces) 
                var newDict = new Dictionary<string, decimal>(oldDictionary)
or in linq
var castedDico = dictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With