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; }
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); } }