public async Task <TEntity> GetByIdAsync(object id) { var currentId = int.Parse(id.ToString()); Expression <Func <TEntity, bool> > predicate = t => t.Id == currentId; return(await EntityContext.Set <TEntity>().FirstOrDefaultAsync(predicate)); }
public RepositoryBase(MarvelContext context) { EntityContext = context; EntityDbSet = EntityContext.Set <TEntity>(); }
public async Task <T> GetById(int id) => await _context.Set <T>().FindAsync(id).AsTask();