How it works...

The LINQ aspect of Rx allows developers to construct observables. Here are some examples:

  • Observable.Empty<>: This returns an empty observable sequence
  • Observable.Return<>: This returns an observable sequence containing a single element
  • Observable.Throw<>: This returns an observable sequence terminating with an exception
  • Observable.Never<>: This returns a non-terminating observable sequence that is infinite in duration

The use of LINQ in Rx allows the developer to manipulate and filter the datastream to return exactly what they need.

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.