This is answered well by @Rufus.
However, here is an extension method for your OCD pleasure. Validates input, returns false on key not found (which you may want as an KeyNotFoundException, depending on your fault tolerance level)
Given
public static class Extensions { private static bool CompareValues<T>( this IReadOnlyDictionary<string, List<T>> source, string key1, string key2) { if (source is null) throw new ArgumentNullException(nameof(source)); if (string.IsNullOrWhiteSpace(key1)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(key1)); if (string.IsNullOrWhiteSpace(key2)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(key2)); if (!source.TryGetValue(key1, out var list1)) return false; if (!source.TryGetValue(key2, out var list2)) return false; return Enumerable.SequenceEqual( list1.OrderBy(x => x), list2.OrderBy(x => x) ); } }
Usage
var result = d1.CompareValues("Inputs","outputs")
Exceptwill remove any duplicates, so likely not.