public async Task <T> AddAsync(T entity) { await _db.Set <T>().AddAsync(entity); await _db.SaveChangesAsync(); return(entity); }
TEntity IRepository <TEntity> .Get(int id) { return(Context.Set <TEntity>().Find(id)); }
public void Add(T entity) { _context.Set <T>().Add(entity); }