Daily Archives: Wednesday, 16 April, 2008

Crazy Extension Method

Here is an example of a crazy extension method that alters the semantics of method calling. First the extension method: public static class MyExtensions { public static bool IsNullOrEmpty(this string target) { return string.IsNullOrEmpty(target); } } Instead of calling the … Continue reading

Posted in Uncategorized | Tagged , , , | 7 Comments

Event: LINQ to XML – Everything but the kitchen sinq

I’ll be speaking at the Scottish Developers event in Glasgow on the 10th June 2008 at the Continuing Professional Development Centre at Glasgow Caledonian University. I’ve be giving an introduction to the new XML classes in .NET 3.5, how they … Continue reading

Posted in Uncategorized | Leave a comment

Fizz-Buzz in LINQ

This just occurred to me. It is somewhat pointless, but I thought it was interesting: static void Main(string[] args) { var result = from say in Enumerable.Range(1, 100) select (say % 15 == 0) ? “BuzzFizz” : (say % 5 … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment