Tagged in

Linq

theburningmonk.com
theburningmonk.com
the personal blog for Yan Cui
More information
Followers
923
Elsewhere
More, on Medium

LINQ OrderBy — using Comparer.Create and F#’s Object Expressions

.Net 4.5 introduced a handy little new method Comparer<T>.Create to aid the creation of bespoke comparers, which is great because it means that you don’t have to define a new Comparer class when it is going to be needed…


Converting List using covariance

I saw an interesting use of covariance today, consider an interface IMyClass and an implementing class MyClass:

1: public interface IMyClass { }
2:
3: public class MyClass : IMyClass { }

Eric Lippert on the decision to omit Enumerable.ForEach

Found another interesting post on Eric Lippert’s blog, this one explain the rationales behind why there’s no built-in Enumerable.ForEach extension method, one which myself and no doubt many others had decided to implement ourselves.


Enumerable.Except returns distinct items

This one took me by surprise a little but there’s something about the Enumerable.Except method which you ought to know about. At first you might have assumed (as I did) that given an array as the base set and calling the Except extension method with a second…


Functional programming with Linq — Enumerable.SequenceEqual

Yet another useful method on the Enumerable class, the SequenceEqual method does exactly what it says on the tin and tells you whether or not two sequences are of equal length and their corresponding elements are equal…