public virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_dbContext != null) { _dbContext.Dispose(); _dbContext = null; } if (_dataContext != null) { _dataContext.Dispose(); _dataContext = null; } } // release any unmanaged objects // set the object references to null _disposed = true; }
public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWorkAsync) { Context = context; UnitOfWorkAsync = unitOfWorkAsync; var dbContext = context as DbContext; DbSet = dbContext.Set <TEntity>(); }
public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWork) { _context = context; _unitOfWork = unitOfWork; var dbContext = context as DbContext; _dbSet = dbContext.Set <TEntity>(); }
public EFUnitOfWork(IGalaxyContextAsync dataContext , IAppSessionContext session , IMediator mediator) { _dataContext = dataContext ?? throw new ArgumentNullException(nameof(dataContext)); _session = session ?? throw new ArgumentNullException(nameof(session)); _repositories = new Dictionary <string, dynamic>(); _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); }
public virtual void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_dataContext != null) { _dataContext.Dispose(); _dataContext = null; } } _disposed = true; }
public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork) { }
public ActiveDbConnectionProvider(IGalaxyContextAsync context) { _context = context; }