我在下面有3个词典:
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>>();
我想填写C Dictionary,默认值= 0,如下所示,我的代码不正确,请帮帮我
C = A.ToDictionary(x => x.Value, B.ToDictionary(y => y.Value, y => 0));
答案 0 :(得分:3)
C = A.ToDictionary(x => x.Value, v=>B.ToDictionary(y => y.Value, y => 0));