Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWorkAsync)
        {
            Context         = context;
            UnitOfWorkAsync = unitOfWorkAsync;

            var dbContext = context as DbContext;

            DbSet = dbContext.Set <TEntity>();
        }
Esempio n. 3
0
        public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWork)
        {
            _context    = context;
            _unitOfWork = unitOfWork;

            var dbContext = context as DbContext;

            _dbSet = dbContext.Set <TEntity>();
        }
Esempio n. 4
0
 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));
 }
Esempio n. 5
0
        public virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                if (_dataContext != null)
                {
                    _dataContext.Dispose();
                    _dataContext = null;
                }
            }
            _disposed = true;
        }
Esempio n. 6
0
 public EFRepository(IGalaxyContextAsync context, IUnitOfWorkAsync unitOfWork) : base(context, unitOfWork)
 {
 }
 public ActiveDbConnectionProvider(IGalaxyContextAsync context)
 {
     _context = context;
 }