EasyRepository/GenericUnitOfWork.cs
/// <inheritdoc />
/// <summary>
///   Begins a transaction for the current UoW.
/// </summary>
/// <exception cref="InvalidOperationException">
///   Thrown in cases that the data context ise not usable or a transaction is already open.
/// </exception>
/// <exception cref="Exception">
///   Thrown when an issue occurs opening a transaction scope.
/// </exception>
Begins a transaction for the current UoW.
Begins a transaction for the current UoW .
public void BeginTransaction()
        {
            this.EnsureContext();
            if (this.transactionScope != null)
            {
                throw new InvalidOperationException("There is already an open transaction");
            }
            try
            {
                this.transactionScope = this.context.Database.BeginTransaction();
            }
            catch (Exception ex)
            {
                throw new Exception($"An error occured while beginning transaction.\r\n{ex.Message}");
            }
        }
public void BeginTransaction ( ) { this . EnsureContext ( ) ; if ( this . transactionScope != null ) { throw new InvalidOperationException ( " " ) ; } try { this . transactionScope = this . context . Database . BeginTransaction ( ) ; } catch ( Exception ex ) { throw new Exception ( $" An error occured while beginning transaction. \r \n { ex . Message } " ) ; } }
Begins a transaction for the current UoW.
Begins a transaction for the current UoW .
Thrown in cases that the data context ise not usable or a transaction is already open.
Thrown in cases that the data context ise not usable or a transaction is already open .
Thrown when an issue occurs opening a transaction scope.
Thrown when an issue occurs opening a transaction scope .
inheritdoc
None