public async Task <TEntity> SelectByIdAsync(TKey id) { try { Expression <Func <TEntity, bool> > predicate = t => t.Id.Equals(id); return(await _context.Set <TEntity>().FirstOrDefaultAsync(predicate)); } catch (Exception ex) { throw ex; } }
public GenericRepository(BeTheHeroSQLiteContext context) { _context = context; _db = _context.Set <TEntity>(); }