There is a dictionary, for example
IDictionary<string, List<Model>> there is a model
public class Model { public string Name { get; set;} public byte[] Data { get; set;} } How can I eliminate duplicate values for Name in the entire Dictionary? Filter existing dictionary. Duplicate Value values must be removed. Those. if in the key "Key1" and in the key "Key2" in the list there is a Name with the same value, then it is necessary to exclude this value for the key (no matter what)
test data
{"key1", {"Name1", <data>}, {"Name2", <data>}, {"Name3", <data>}} {"key2", {"Name4", <data>}, {"Name2", <data>}, {"Name5", <data>}} result
{"key1", {"Name1", <data>}, {"Name2", <data>}, {"Name3", <data>}} {"key2", {"Name4", <data>}, {"Name5", <data>}} or
{"key1", {"Name1", <data>}, {"Name3", <data>}} {"key2", {"Name4", <data>}, {"Name2", <data>}, {"Name5", <data>}}