public virtual T MakeRepository <T>(Func <BPAContext, object> factory, BPAContext dbContext) { var f = factory ?? _repositoryFactories.GetRepositoryFactory <T>(); if (f == null) { throw new NotImplementedException($"No factory for repository type, {typeof(T)}"); } var repo = (T)f(dbContext); Repositories[typeof(T)] = repo; return(repo); }
public BPARepo() { DbContext = new BPAContext(); SetContextDefaults(); CreateRepositories(); }
public Repository(BPAContext bpaDbContext) { _bpaDbContext = bpaDbContext; DbSet = _bpaDbContext.Set <T>(); }