using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1.Else { internal class EnumerableSequenceEqualTest { public static void Test() { var a = new Dictionary() { { "0", "1" }, { "2", "3" } }; var b = new Dictionary() { { "2", "3" }, { "0", "1" } }; var equl = CheckIsEqual(a, b); } private static bool CheckIsEqual(Dictionary d1, Dictionary d2) { return d1.Count == d2.Count && d1.All( (d1KV) => d2.TryGetValue(d1KV.Key, out var d2Value) && ( d1KV.Value == d2Value || d1KV.Value?.Equals(d2Value) == true) ); } } }