2013-08-25 46 views
0

我有以下3字典:LINQ .ToDictionary二維字典

Dictionary<string, int> A = new Dictionary<string, int>(); 
Dictionary<string, int> B = new Dictionary<string, int>(); 
Dictionary<int, Dictionary<int, int>> C = new Dictionary<int, Dictionary<int, int>>(); 

我要填寫ç詞典默認值= 0像下面和我的代碼不正確,請大家幫我

C = A.ToDictionary(x => x.Value, B.ToDictionary(y => y.Value, y => 0)); 
+1

不清楚你想要做什麼。 – I4V

回答

3
C = A.ToDictionary(x => x.Value, v=>B.ToDictionary(y => y.Value, y => 0));