Reputation: 44605
I am working with C# and have an IEnumerable object. Note(IEnumerable and not IEnumerable<T>)
IEnumerable
IEnumerable<T>
How can I find the distinct items in that object?
Upvotes: 0
Views: 975
Reputation: 149020
Use Cast, then Distinct
Cast
Distinct
var distinctItems = items.Cast<object>().Distinct();
Upvotes: 4