public void TransactionScopeWrapper() { var scope = new TransactionScopeWrapper(); scope.Complete(); scope.Dispose(); }
public ResultDto Delete(Guid recipeInstructionId, Guid userId) { var result = new ResultDto(); using (ITransactionScope scope = new TransactionScopeWrapper()) { this.recipeInstructionDA.Delete(recipeInstructionId, userId); scope.Complete(); } return(result); }
public ITransactionScope CreateScope( IsolationLevel?isolationLevel = default) { TransactionsLogMessages.TransactionScopeCreating(_logger); var result = new TransactionScopeWrapper(_logger, new TransactionOptions() { IsolationLevel = isolationLevel ?? IsolationLevel.ReadCommitted, Timeout = TimeSpan.FromSeconds(30) }); TransactionsLogMessages.TransactionScopeCreated(_logger); return(result); }
public ResultDto Save(RecipeInstructionDto saveItem, Guid userId) { var result = this.Validate(saveItem); if (result.IsSuccess) { using (ITransactionScope scope = new TransactionScopeWrapper()) { result.Result = this.recipeInstructionDA.Save(saveItem, userId); scope.Complete(); } } return(result); }