public UnitOfWork() { if (string.IsNullOrEmpty(_nameOrConnectionString)) { throw new InvalidOperationException("Database name or connection string is null."); } _dbContext = new SimpleDbContext(_nameOrConnectionString, _entities); _repositories = new Hashtable(); foreach (var attribute in _attributes) { if (!_repositories.ContainsKey(attribute)) { var proxy = _proxyGenerator.CreateInterfaceProxyWithoutTarget(attribute, new RepositoryInterceptor(_dbContext)); _repositories.Add(attribute, proxy); } } }
public RepositoryInterceptor(SimpleDbContext dbContext) { _dbContext = dbContext; }
public SimpleRepository(SimpleDbContext dbContext) { _dbContext = dbContext; }