我有两个字典如下:
词典 1:
Dictionary<string, string> dict1 = new Dictionary<string, string>();
request.Add("key1", "value1");
request.Add("key2", "value2");
request.Add("key3", "value3");
字典 2:
Dictionary<string, string> request = new Dictionary<string, string>();
request.Add("key1", "value1");
request.Add("key2", "value2");
我需要使用带有条件的 LINQ 查询来比较上述两个字典:
1) dict2 中的所有键都应与 dict1 中的键匹配
2)匹配的键值应该相等
3)即使dict2中key2的值为空,也应该匹配
对上面的帮助表示赞赏。提前致谢。
问候,
萨钦