V
V
Vignore2018-01-29 11:15:10
C++ / C#
Vignore, 2018-01-29 11:15:10

How to find identical occurrences in a dictionary?

Change has a dictionary IDictionary> productDictionary The ProductModel has a string array string[] codes. How to find in the dictionary all ProductModels that have the same values ​​in the codes array?
Those. one entity has codes = { '123', 1234'}, and the other has codes = { '12353453', 1234'}. These are the ones I need to find. They have matches on the value '1234'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kovalsky, 2018-01-29
@dmitryKovalskiy

If through LINQ it seems like this
arr1.Where(d => arr2.Contains(d));

M
MrDywar Pichugin, 2018-01-29
@Dywar

There are two sets.
IEnumerable.Except - find the difference.
IEnumerable.Intersect - find the intersection.
https://msdn.microsoft.com/en-us/library/9eehta0(...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question