Browse by Tags
All Tags »
Tools: Linq Extensions (
RSS)
Here we go with the third installment of the Extension Method Roundup. The reason behind these 'code dumps' is that LINQ is a central part of my coding and always find new problems I want to find elegant solutions to. Hope these prove as useful to you...
As a rule of thumb, when presented with two independent blocking I/O operations on more than one independent devices, it's best to use threads to create parallel operations, instead of waiting for a single synchronous operation to complete. That way,...
Hey hey hey! It's time for another Extension Methods Roundup! Here are some of the extension methods I've written since the last one: Dictionary's Missing Remove Methods public static void Remove<TKey, TValue>( this IDictionary <TKey, TValue>...
As I do from time to time, here is a batch of three Extension Methods I've written recently: IndicesWhere /// <summary> /// Gets the indices where the predicate is true. /// </summary> public static IEnumerable < int > IndicesWhere<T>...
Sometimes you want to use FirstOrDefault , but the default value of T is a valid value that might get returned. If you used FirstOrDefault , you wouldn't know whether the value that you got is a valid first or the default fallback. I use FirstOrFallback...
I've updated my long standing Linq Extensions project on CodePlex to .NET 3.5 RTM and added the latest extension methods. You can open bugs and feature requests using the Issue Tracker . If you want to download it, go and download the source code directly...
Enumerating over a Dictionary<TKey, TValue> you will get structs of type KeyValuePair<TKey, TValue> . Whenever you use the ToDictionary extension method, you are forced to specify how to get the key and value for each item, even if it's an...
Here's another Linq method I wanted to share. This one takes two enumerations, enumeration and subset and checks to see whether subset exists in enumeration in its original order. I used the naming convention set by SequenceEqual . Examples: enumeration...
I've created a couple of useful extension methods that I like to use with Linq, so here they are: ContainsAtLeast I've noticed that there's no way to find out whether a collection has at least X items. The following takes the collection, tries to take...
My new Linq Extensions project for the Linq May CTP is now up on CodePlex and I've released beta 1 (numbered 0.1). It took me a while to understand how to work with it and the connection to the Team Foundation Server wasn't as fast as I had hoped, but...
More Posts
Next page »