Skip to content

Commit

Permalink
Added configure await
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Calmes committed Oct 17, 2024
1 parent c21f874 commit a5a7f08
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Ardalis.Result/ResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public static async Task<Result<TDestination>> BindAsync<TSource, TDestination>(
var result = await resultTask;
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus<TSource, TDestination>(result),
};
}
Expand All @@ -169,8 +169,8 @@ public static async Task<Result> BindAsync<TSource>(
var result = await resultTask;
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus(result),
};
}
Expand All @@ -181,8 +181,8 @@ public static async Task<Result> BindAsync<TSource>(
{
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus(result),
};
}
Expand All @@ -193,8 +193,8 @@ public static async Task<Result> BindAsync(
{
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus(result),
};
}
Expand All @@ -206,8 +206,8 @@ public static async Task<Result<TDestination>> BindAsync<TDestination>(
var result = await resultTask;
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus<TDestination>(result),
};
}
Expand All @@ -218,8 +218,8 @@ public static async Task<Result<TDestination>> BindAsync<TSource, TDestination>(
{
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus<TSource, TDestination>(result),
};
}
Expand All @@ -230,8 +230,8 @@ public static async Task<Result> BindAsync<TSource, TDestination>(
{
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result.Value),
ResultStatus.Created => await bindFunc(result.Value),
ResultStatus.Ok => await bindFunc(result.Value).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result.Value).ConfigureAwait(false),
_ => HandleNonSuccessStatus(result),
};
}
Expand All @@ -241,8 +241,8 @@ public static async Task<Result> BindAsync(this Task<Result> resultTask, Func<Re
var result = await resultTask;
return result.Status switch
{
ResultStatus.Ok => await bindFunc(result),
ResultStatus.Created => await bindFunc(result),
ResultStatus.Ok => await bindFunc(result).ConfigureAwait(false),
ResultStatus.Created => await bindFunc(result).ConfigureAwait(false),
_ => HandleNonSuccessStatus(result),
};
}
Expand Down

0 comments on commit a5a7f08

Please sign in to comment.