Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A Task-based LINQ designed to work with async/await
C#
Branch: master

Merge pull request #2 from JamesTryand/master

updated the Rx packages to use the latest stable version
latest commit f2cf9f4269
@paulcbetts authored
Failed to load latest commit information.
.nuget Initial Import
LinqToAwait forgot to update the version and nuspec files
NuGet forgot to update the version and nuspec files
.gitignore Add packages since we're using NuGet Package Restore
LICENSE Add License
LinqToAwait.sln
README.md Update README.md

README.md

LinqToAwait

In a world where many methods return Task<T> or other Awaitable types (especially in WinRT), LINQ can't be used nearly as easily. Enter LinqToAwait:

using System;
using System.Reactive.Linq;
using LinqToAwait;

var inputs = new[] { 
    "http://www.google.com", 
    "http://www.yahoo.com", 
    "http://www.aol.com", 
};

IEnumerable<string> results = await inputs.AsAsync()
    .WhereAsync(async x => await IsPageInTop10WebSitesByTrafficAsync(x))
    .SelectAsync(async x => await DownloadPageAsync(x))
    .Select(x => x.Substring(0, 50))
    .GetResults();

>>> ["<html>...."]

Where does this work?

You're going to need Visual Studio 2012 - you can use LinqToAwait with .NET 4.5 applications.

Hey, isn't this kind of like Rx?

It is Rx! However, it is a simplification of the API used for a more specific use-case. Instead of choosing async/await or Rx, LinqToAwait helps you use both at the same time, applying the most straightforward technique for the particular problem.

How do I get started?

It's .NET, how else? Use NuGet!.

Install-Package LinqToAwait
Something went wrong with that request. Please try again.