Beispiel #1
0
 public virtual async Task <T> GetByIdAsync(int id)
 {
     return(await _dbContext.Set <T>().FindAsync(id));
 }
Beispiel #2
0
 public BaseRepository(TaskManagerDbContext context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
Beispiel #3
0
 public async Task Add(T entity)
 {
     _context.Set <T>().Add(entity);
     await _context.SaveChangesAsync();
 }