DotAwait 1.0.0-preview.1
See the version list below for details.
dotnet add package DotAwait --version 1.0.0-preview.1
NuGet\Install-Package DotAwait -Version 1.0.0-preview.1
<PackageReference Include="DotAwait" Version="1.0.0-preview.1" />
<PackageVersion Include="DotAwait" Version="1.0.0-preview.1" />
<PackageReference Include="DotAwait" />
paket add DotAwait --version 1.0.0-preview.1
#r "nuget: DotAwait, 1.0.0-preview.1"
#:package DotAwait@1.0.0-preview.1
#addin nuget:?package=DotAwait&version=1.0.0-preview.1&prerelease
#tool nuget:?package=DotAwait&version=1.0.0-preview.1&prerelease
DotAwait is still in early development. Use with caution!
DotAwait
Write await in a fluent/LINQ-friendly style with a single .Await() extension call.
Why
In C#, await forces you to �drop out� of the fluent chain:
var names = (await service.GetUsersAsync())
.Where(u => u.IsActive)
.Select(u => u.Name)
.ToArray();
With DotAwait, you can keep the chain intact:
var names = service
.GetUsersAsync()
.Await()
.Where(u => u.IsActive)
.Select(u => u.Name)
.ToArray();
How it works
At build time, an MSBuild target rewrites .Await() calls into the await keyword.
If you get a runtime exception from an Await stub, the rewrite step didn�t run.
User defined task-like types
DotAwait supports user-defined task-like types.
To make your type compatible you should add the following definition to your project:
namespace DotAwait
{
internal static partial class DotAwaitTaskExtensions
{
public static T Await<T>(this MyTaskType<T> lazy) => Throw<T>();
public static void Await(this MyTaskType lazy) => Throw();
}
}
It's not required to add both void and generic overloads, only those that you need.
License
This project is licensed under the MIT License
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.7 | 81 | 1/14/2026 |
| 1.0.0-preview.6 | 74 | 1/9/2026 |
| 1.0.0-preview.5 | 75 | 1/8/2026 |
| 1.0.0-preview.4 | 79 | 1/5/2026 |
| 1.0.0-preview.3 | 85 | 1/4/2026 |
| 1.0.0-preview.2 | 81 | 1/3/2026 |
| 1.0.0-preview.1 | 86 | 1/3/2026 |