LinqAF: Release 3.0.0
Posted: 2018/06/10 Filed under: code Comments Off on LinqAF: Release 3.0.0A new release (3.0.0) of LinqAF is now available on NuGet, and it’s got a decent amount of new stuff.
New Operators
LinqAF 3.0.0 introduces the following operators:
- Append (added in .NET Framework 4.7.1)
- Prepend (likewise)
- SkipLast (added in .NET Core 2.0)
- TakeLast (likewise)
- ToHashSet (adding in .Net Framework 4.7.2)
In particular I found myself really wanting ToHashSet() when I was playing around with converting existing projects to LinqAF, practically every project seems to have a homegrown version.
Convenience Methods
IEnumerable<T> is used all over the place in .NET, and in prior versions of LinqAF you’d need to add an AsEnumerable call to call them. Even worse, some methods (like those on String) take either IEnumerable<T> or object so porting to LinqAF could introduce bugs.
Now LinqAF provides implementations, as extension methods, of the following methods that take all of LinqAF’s enumerables:

Choosing relevant images is hard.
- HashSet<T>, ISet<T>, and SortedSet<T>’s
- ExceptWith
- IntersectWith
- IsProperSubset
- IsProperSuperset
- IsSubsetOf
- IsSupersetOf
- Overlaps
- SetEquals
- SymmetricExceptWith
- UnionWith
- List<T>
- AddRange
- InsertRange
New classes have been added that provide implementations of commonly used static methods, as well as pass-throughs to the normal classes:
- LinqAFString as an alternative to System.String, providing LinqAF friendly versions of
- Concat
- Join
- LinqAFTask as an alternative to System.Threading.Task, with friendly versions of
- WaitAll
- WaitAny
- WhenAll
- WhenAny
Additionally, a helper class for calling the constructors of built-in collections has been added, LinqAFNew, which provides methods equivalent to the enumerable consuming constructors of:
- HashSet<T>
- LinkedList<T>
- List<T>
- Queue<T>
- SortedSet<T>
- Stack<T>
Performance Improvements
The biggest change is that RangeEnumerable and ReverseRangeEnumerable are no longer generic, making the performance of anything involving Enumerable.Range() considerably faster as there’s no reflection going on.
The Future
At this point LinqAF is pretty close to feature complete, I don’t think I’ll be adding many more operations. I am quite interested in increasing the performance of the current operators, while LinqAF is always lower in allocations it remains slower than LINQ-to-Objects for many cases.