Comparing 2 Dictionary Instances

后端 未结 4 1837
忘掉有多难
忘掉有多难 2020-12-03 09:33

I want to compare the contents of two Dictionary instances regardless of the order of the items they contain. SequenceEquals

4条回答
  •  被撕碎了的回忆
    2020-12-03 10:11

    This will check if all Values from source exists in target, ignoring the Keys

    var result = source.All(x => target.Any(y => x.Value == y.Value));
    

提交回复
热议问题