Pass a lambda expression in place of IComparer or IEqualityComparer or any single-method interface?

I’m not much sure what useful it really is, as I think for most cases in the Base Library expecting an IComparer there’s an overload that expects a Comparison… but just for the record:

in .Net 4.5 they’ve added a method to obtain an IComparer from a Comparison:
Comparer.Create

so you can pass your lambda to it and obtain an IComparer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)