LINQ

Functional programming with Linq – Enumerable.OfType

Of all the methods available on the Enumerable class, OfType<T> is arguably one of the most useful and yet under utilized method. For example, you have a list of Cat and Dog objects, all inheriting from a common Animal class, but occasionally you want to perform operations on only the dogs or cats, and that’s …

Functional programming with Linq – Enumerable.OfType Read More »

NHibernate 2.1.0 GA with LINQ to NHibernate and FluentNHibernate

I ran into a versioning problem when I tried to use the latest version of FluentNHibernate with the latest version of LINQ to NHibernate because LINQ to NHibernate is built using a later version of the NHibernate binaries. After doing a little search, I found a version of NHibernate which both LINQ to NHibernate and …

NHibernate 2.1.0 GA with LINQ to NHibernate and FluentNHibernate Read More »

Functional programming with Linq – Enumerable.Range

In my Learning F# posts you probably saw how you can generate an int array like this: this returns 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. This is pretty cool, and fortunately, you have something very similarly in C# with Enumerable.Range which you can use by supplying a starting number and a …

Functional programming with Linq – Enumerable.Range Read More »

Rx framework – IObservable<T>.Repeat

Having looked at a number of extension methods in Rx which allows you to combine two observable collections in some way, namely: Zip Merge CombineLatest Concat Catch OnErrorResumeLast There are also extension methods which allow you to repeatedly subscribe to the same observable collection, the suitably name IObservable<T>.Repeat method. If the repeated observable collection is …

Rx framework – IObservable<T>.Repeat Read More »

Rx framework – IObservable<T>.Catch and IObservable<T>.OnErrorResumeNext

Like IObservable<T>.Concat, the IObservable<T>.Catch extension method concatenates an observable collection with another. However, unlike the Concat method where the subscription to the second observable collection happens after the first had completed, in the Catch method the subscription to the second collection happens after and only after the first had excepted! Which begs a very good …

Rx framework – IObservable<T>.Catch and IObservable<T>.OnErrorResumeNext Read More »

Rx framework – IObservable<T>.Concat

Yet another extension method to combine two observable collections, this time we have IObservable<T>.Concat which is very similar to IObservable<T>.Merge, but crucially, when you concatenate one observable collection to another, the subscription to the second observable collection happens after the first had completed! Here’s a quick illustration of how the two methods differ: As you’ve …

Rx framework – IObservable<T>.Concat Read More »

Rx framework – IObservable<T>.CombineLatest

The IObservable<T>.CombineLatest extension method is very similar to IObservable<T>.Zip and IObservable<T>.Merge in that it combines two observable collections and returns a new one. Unlike IObservable<T>.Merge, IObservable<T>.CombineLatest does not require the merged observable collections to be of the same type. Like IObservable<T>.Zip, IObservable<T>.CombineLatest combines ‘pairs‘ of values from the two observable collections, but unlike Zip when …

Rx framework – IObservable<T>.CombineLatest Read More »

Rx framework – IObservable<T>.Merge

In my previous post I used the IObservable<T>.Zip extension method in the Drag-and-Drop example, which takes two observable collections and runs a function over them to return a new observable collection of potentially a different type. But what if you just want to simply merge the two observable collections into one stream? Well, Rx API …

Rx framework – IObservable<T>.Merge Read More »

Linq Over Events – Playing with the Rx Framework

As you may have read about on numerous MVP’s blogs already, there’s an ongoing research project at Microsoft’s DevLabs called Reactive Extensions for .Net (Rx) which introduces a push-style duality (equal and opposite) of the traditional pull-style enumeration using Linq. Erik Meijer gave a 30 mins introduction to the reactive framework in this video, I …

Linq Over Events – Playing with the Rx Framework Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close