示例#1
0
        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);
        }
示例#2
0
 public EfRepository(RestoDbContext context)
 {
     _dbContext = context;
     _dbSet     = _dbContext.Set <TEntity>();
 }
示例#3
0
 public ApplicationUow(RestoDbContext dbContext)
 {
     _dbContext        = dbContext;
     RepositoriesCache = new Dictionary <Type, object>();
 }