Last active
April 9, 2019 10:06
-
-
Save dmitryvk/6623484f7faff7452be2f5b5cfe2af35 to your computer and use it in GitHub Desktop.
Mono Transaction Scope
This file contains hidden or 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<ProjectGuid>{17C90BFF-D5EB-4FF4-BB67-BCCA7535E6A1}</ProjectGuid> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net472</TargetFramework> | |
<AssemblyTitle>MonoTxScope</AssemblyTitle> | |
<Product>MonoTxScope</Product> | |
<Copyright>Copyright © 2019</Copyright> | |
</PropertyGroup> | |
<ItemGroup> | |
<Reference Include="System.Transactions" /> | |
</ItemGroup> | |
</Project> |
This file contains hidden or 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
namespace MonoTxScope | |
{ | |
using System; | |
using System.Transactions; | |
internal class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var options = new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }; | |
using (new TransactionScope(TransactionScopeOption.Required, options)) | |
{ | |
Console.WriteLine(Transaction.Current.IsolationLevel); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment