c# - What is the leanest way to convert a Dictionary<string, string> to a Dictionary<string, object>? -
I am using an API that returns a key-value archive as a dictionary & Lt; String, string & gt;
. Let me give it a dictionary & lt; String, Object & gt;
I need to have a way of doing this without looping "manually" through this conversion / mapping of each key-value pair, but in the Googling or C # object context No solution found immediately.
try the following
var newMap = oldMap.ToDictionary (pair = & Gt; pair.Key, pair => (object) pair.Value);
Comments
Post a Comment