public LinqToSqlUnitOfWork(ILinqSession <TDataContext> context) { if (context == null) { throw new ArgumentNullException("context"); } _linqContext = context; }
/// <summary> /// Disposes off manages resources used by the LinqToSqlUnitOfWork instance. /// </summary> /// <param name="disposing"></param> private void Dispose(bool disposing) { if (!disposing) { return; } if (_disposed) { return; } if (_transaction != null) { _transaction.Dispose(); _transaction = null; } if (_linqContext != null) { _linqContext.Dispose(); _linqContext = null; } _disposed = true; }
/// <summary> /// Default Constructor. /// Creates a new instance of the <see cref="LinqToSqlUnitOfWork"/> class that uses the specified data context. /// </summary> /// <param name="context">The <see cref="DataContext"/> instance that the LinqToSqlUnitOfWork instance uses.</param> public LinqToSqlUnitOfWork(ILinqSession context) { Guard.Against <ArgumentNullException>(context == null, "Expected a non-nul DataContext instance"); _linqContext = context; }
/// <summary> /// Default Constructor. /// Creates a new instance of the <see cref="LinqToSqlUnitOfWork"/> class that uses the specified data context. /// </summary> /// <param name="context">The <see cref="DataContext"/> instance that the LinqToSqlUnitOfWork instance uses.</param> public LinqToSqlUnitOfWork(ILinqSession context) { Guard.Against<ArgumentNullException>(context == null, "Expected a non-nul DataContext instance"); _linqContext = context; }
/// <summary> /// Disposes off manages resources used by the LinqToSqlUnitOfWork instance. /// </summary> /// <param name="disposing"></param> private void Dispose(bool disposing) { if (!disposing) return; if (_disposed) return; if (_transaction != null) { _transaction.Dispose(); _transaction = null; } if (_linqContext != null) { _linqContext.Dispose(); _linqContext = null; } _disposed = true; }