Skip to content

Commit

Permalink
Merge pull request #229 from mnissl/BindWithTransactionScope
Browse files Browse the repository at this point in the history
BindWithTransactionScopeAsync(Both/Left/Right) support Result<T, E>
  • Loading branch information
vkhorikov authored Aug 28, 2020
2 parents 699eaa9 + f75257a commit 5755291
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace CSharpFunctionalExtensions
{
public static partial class ResultExtensions
{
public static Task<Result<K, E>> BindWithTransactionScope<T, K, E>(this Task<Result<T, E>> self, Func<T, Task<Result<K, E>>> f)
=> WithTransactionScope(() => self.Bind(f));

public static Task<Result<K>> BindWithTransactionScope<T, K>(this Task<Result<T>> self, Func<T, Task<Result<K>>> f)
=> WithTransactionScope(() => self.Bind(f));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace CSharpFunctionalExtensions
{
public static partial class ResultExtensions
{
public static Task<Result<K, E>> BindWithTransactionScope<T, K, E>(this Task<Result<T, E>> self, Func<T, Result<K, E>> f)
=> WithTransactionScope(() => self.Bind(f));

public static Task<Result<K>> BindWithTransactionScope<T, K>(this Task<Result<T>> self, Func<T, Result<K>> f)
=> WithTransactionScope(() => self.Bind(f));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace CSharpFunctionalExtensions
{
public static partial class ResultExtensions
{
public static Task<Result<K, E>> BindWithTransactionScope<T, K, E>(this Result<T, E> self, Func<T, Task<Result<K, E>>> f)
=> WithTransactionScope(() => self.Bind(f));

public static Task<Result<K>> BindWithTransactionScope<T, K>(this Result<T> self, Func<T, Task<Result<K>>> f)
=> WithTransactionScope(() => self.Bind(f));

Expand Down

0 comments on commit 5755291

Please sign in to comment.