Exemple #1
0
        public IBaseSourceDbContext Init()
        {
            if (_context != null)
            {
                return(_context);
            }

            _context = CreateObject(() => new BaseSourceDbContext(Constants.CONNECTION_STRING));

            return(_context);
        }
Exemple #2
0
        //private IAccountRepository AccountRepository => _accountRepository ?? (_accountRepository = new AccountRepository(_context));
        //private IProfileRepository ProfileRepository => _profileRepository ?? (_profileRepository = new ProfileRepository(_context));
        //private IClientRepository ClientRepository => _clientRepository ?? (_clientRepository = new ClientRepository(_context));

        protected override void DisposeCore()
        {
            _factory = null;
            _context = null;

            //_clientRepository = null;
            //_clientAdminRepository = null;
            //_clientSiteRepository = null;


            base.DisposeCore();
        }
Exemple #3
0
 protected Repository(IBaseSourceDbContext context)
 {
     _context = context;
 }
Exemple #4
0
 public UnitOfWork(IBaseSourceDbContext context)
 {
     _context = context;
 }
Exemple #5
0
        //private IClientRepository _clientRepository;
        //private IClientAdminRepository _clientAdminRepository;
        //private IClientSiteRepository _clientSiteRepository;

        public UnitOfWork()
        {
            _factory = CreateObject(() => new DbFactory());
            _context = _factory.Init();
        }
Exemple #6
0
 public DbFactory(IBaseSourceDbContext context)
 {
     _context = context;
 }
Exemple #7
0
 protected override void DisposeCore()
 {
     _context = null;
 }