Using LINQ to perform queries
Rx allows developers to use the IObservable
interface, which represents synchronous datastreams, to write queries using LINQ. To recap, Rx can be thought of as consisting of three sections:
- Observables: The interface that brings together and represents all these datastreams
- Language-Integrated Query (LINQ): The ability to use LINQ to query these multiple datastreams
- Schedulers: Parameterizing concurrency using schedulers
In this recipe, we will be looking at the LINQ functionality of Rx in more detail.
Getting ready
As observables are just datastreams, we can use LINQ to query them. In the following recipe, we will output text to the screen based on a LINQ query.
How to do it...
- Start by adding a new Windows forms project to your solution.
- Call the project
winformRx
and click on theOK
button:
- In
Toolbox
, search for theTextBox
control and add it to your form.
- Finally, add a label control to your form:

- Right-click on your
winformRx
project and selectManage NuGet Packages...