Exemplo n.º 1
0
        public UnitOfWork(cEditorContext dbContext, IRepository repository)
        {
            if (dbContext == null) throw new ArgumentNullException(nameof(dbContext));
            if (repository == null) throw new ArgumentNullException(nameof(repository));

            _dbContext = dbContext;
            _repository = repository;
        }
Exemplo n.º 2
0
        public IUnitOfWork Create()
        {
            try
            {
                var dbContext = new cEditorContext(_connectionStringProvider.GetConnectionString,
                SystemConst.AssemblyConvention);
                var repository = new Repository(dbContext);
                var result = new UnitOfWork(dbContext, repository);

                return result;
            }
            catch (DataException ex)
            {
                throw new DbFatalException(ex);
            }
        }