public async System.Threading.Tasks.Task <T> Add(T entity) { _ctx.Set <T>().Add(entity); await _ctx.SaveChangesAsync(); return(entity); }
private IQueryable <T> InsializeQuery <T>(params Expression <Func <T, object> >[] includes) where T : class { var query = _context.Set <T>().AsQueryable(); if (includes.Any()) { foreach (var include in includes) { query = query.Include(include); } } return(query); }
public GenericRepository(DatingAppContext context) { this._context = context; _entitySet = _context.Set <TEntity> (); }
public SaveRepository(DatingAppContext context) { this.context = context; this.dbSet = context.Set <T>(); }
public async Task <List <User> > GetAllusers() { return(await _context.Set <User>().Include(u => u.Group).ToListAsync()); }