public async Task Add(T entity) { await context.Set <T>().AddAsync(entity).ConfigureAwait(false); await context.SaveChangesAsync().ConfigureAwait(false); }
public async Task <IEnumerable <Order> > FindAsync(Expression <Func <Order, bool> > expression) { return(await _WebApiDbContext.Set <Order>().Where(expression).ToListAsync().ConfigureAwait(false)); }
public IQueryable <T> GetItems() { return(db.Set <T>()); }
public virtual TEntity BuscarPorId(int id) { return(Context.Set <TEntity>().Find(id)); }
/// <summary> /// Public Constructor,initializes privately declared local variables. /// </summary> /// <param name="context"></param> public GenericRepository(WebApiDbContext context) { this.Context = context; this.DbSet = context.Set <TEntity>(); }