protected virtual T MakeRepository <T>(Func <RestoDbContext, object> factory, RestoDbContext dbContext) { //var f = factory ?? _repositoryFactories.GetRepositoryFactory<T>(); if (factory == null) { throw new ArgumentNullException("No factory for repository type: " + typeof(T).FullName); } var repo = (T)factory(dbContext); RepositoriesCache[typeof(T)] = repo; return(repo); }
public EfRepository(RestoDbContext context) { _dbContext = context; _dbSet = _dbContext.Set <TEntity>(); }
public ApplicationUow(RestoDbContext dbContext) { _dbContext = dbContext; RepositoriesCache = new Dictionary <Type, object>(); }