MCS UK Solution Development Team

The blog of the UK Solutions Development Team of Microsoft Consulting Services.

Browse by Tags

Tagged Content List
  • Blog Post: LINQ, collections and null reference exceptions

    This short post describes an idiosyncrasy of LINQ that, for someone with several years of C# experience I should probably have known about, but didn't. During development of an app the test team reported that a null reference exception was intermittently occurring. For a seasoned developer like myself...
  • Blog Post: String extension methods rather than using RegEx

    In a recent project I was using regular expressions a lot for validating string expressions such that statements like the following were true: Must be all characters Must be all alphanumeric’s and be of length 6 Must be all numeric digits (e.g. “3648”) Must be all upper case characters However in reflection...
  • Blog Post: IEnumerable Distinct through a Func extension method

    In a recent posting, available here , I tried to explain why the IEnumerable Distinct() method employs an IEqualityComparer implementation. In this posting I will provide a simple extension to IEnumerable for the Distinct() method that allows one to use a Func to determine a property on which the Distinct...
  • Blog Post: LINQ Distinct and IEqualityComparer Implementation

    As you may know when working with LINQ there is a method that allows one to return distinct elements from a sequence. Two prototypes are supported: Distinct<TSource>(IEqualityComparer<TSource>) Distinct() Unlike most sequence operations that take some form of a Func parameter, the...
Page 1 of 1 (4 items)