AnonymousComparer - lambda compare selector for Linq

 One guy from Japan created a very cool linq extension. It is called AnonymousComparer, which allows to use Func instead of annoying IEqualityComparer.

    var anonymous = new[] 
{
new { Foo = "A", Key = 10 },
new { Foo = "B", Key = 15 }
};
// true
anonymous.Contains(new { Foo = "dummy", Key = 10 }, a => a.Key);

 

No Comments