c# - Get Non-Distinct elements from an IEnumerable -


I have a class called an item in the item that has an identifier property that is called an item code which is a string. I want to get a list of all non-specific items in the list of items.

Example:

  list & lt; Items & gt; New item ("code2", "description2"), new item ("code2", "description3")}};  

I want a list containing two entries below

If I

  Var use different items = itemsList.Distinct ();  

I get a list of different items which are great, but I want to be almost the opposite. I can reduce the separate list but it will not include all iterations, each will be just one example.

I had a play and one Interesting solution can not be detected. No sign or help would be greatly appreciated Thanks!

I have 3.5, so LINQ is available

Take my:

  var distinctItems = From the list in the list of listed groups in the list. ItemCode is grouped where the grouping Calculate ()> 1 grouped select;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -