I have the following code:
IEqualityComparer<WorkItem> comparer =
new LambdaComparer<WorkItem>((item1, item2) => item1.Type == item2.Type);
var someVar = Pad.Distinct(comparer);
(The idea is to get 1 of each type)
And it gives the following error message:
The type arguments for method 'System.Linq.Enumerable.Distinct
(System.Collections.Generic.IEnumerable,
System.Collections.Generic.IEqualityComparer) 'cannot be inferred
from the usage. Try specifying the type arguments explicitly. 490
I did something similar and it works fine:
Pad = new Dictionary<WorkItem, Canvas>(new LambdaComparer<WorkItem>((x, y) => x.Id == y.Id, x => x.Id));
Therefore, I do not think this is my LamdaComparer class.
Any ideas on how to fix this? (I think I could just do ForEach and get the report manually).
source
share