public Repository(IDataContextAsync context) { _context = context; // Temporarily for FakeDbContext, Unit Test and Fakes DbContext dbContext = context as DbContext; if (dbContext != null) { _dbSet = dbContext.Set <TEntity>(); } else { IFakeDbContext fakeContext = context as IFakeDbContext; if (fakeContext != null) { _dbSet = fakeContext.Set <TEntity>(); } } }
public IQueryable <T> All <T>() where T : class, new() { return(_context.Set <T>().AsQueryable()); }