public async Task <T> AddAsync(T entity) { _dbContext.Set <T>().Add(entity); await _dbContext.SaveChangesAsync(); return(entity); }
public async Task <IReadOnlyList <T> > GetAllAsync() { return(await _dbContext.Set <T>().ToListAsync()); }
public GenericRepo(WebAppContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
protected RepositoryBase(WebAppContext dbContext) { this.dbContext = dbContext; dbSet = dbContext.Set <T>(); }
public GenericRepository(WebAppContext context) { this.context = context; dbSet = context.Set <TEntity>(); }