Skip to content

Instantly share code, notes, and snippets.

@dmitryvk
Last active April 9, 2019 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitryvk/6623484f7faff7452be2f5b5cfe2af35 to your computer and use it in GitHub Desktop.
Save dmitryvk/6623484f7faff7452be2f5b5cfe2af35 to your computer and use it in GitHub Desktop.
Mono Transaction Scope
<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>
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