public static void RunInTransactionScope(CompletionType completionType, Action action, double timeoutSeconds = 60D, OptionType optionType = OptionType.Required) { using (var t = new TransactionScope(optionType.Convert(), new TransactionOptions { Timeout = TimeSpan.FromSeconds(timeoutSeconds), IsolationLevel = IsolationLevel.Serializable })) { action(); if (completionType == CompletionType.Commit) { t.Complete(); } } }