-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(#59): Added SuppressTransaction to TransactionScopeHandler
- Loading branch information
1 parent
ccc6439
commit 84b936c
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Common/src/Transactions/TransactionScopeHandlerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) Fusonic GmbH. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE file in the project root for license information. | ||
|
||
using System.Transactions; | ||
|
||
namespace Fusonic.Extensions.Common.Transactions; | ||
|
||
public static class TransactionScopeHandlerExtensions | ||
{ | ||
public static async Task<T> SuppressTransaction<T>(this ITransactionScopeHandler transactionScopeHandler, Func<Task<T>> action) | ||
=> await transactionScopeHandler.RunInTransactionScope(action, TransactionScopeOption.Suppress); | ||
|
||
public static async Task SuppressTransaction(this ITransactionScopeHandler transactionScopeHandler, Func<Task> action) | ||
=> await transactionScopeHandler.RunInTransactionScope(action, TransactionScopeOption.Suppress); | ||
} |