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

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

.net - Self Tracking Entities (STE)'s and partial updates with EF4 and mVC2 -