예제 #1
0
        public virtual async Task <TEntity> GetByIdAsync(TKey id)
        {
            Expression <Func <TEntity, bool> > predicate = t => t.Id.ToString() == id.ToString();

            return(await _context.Set <TEntity>().FirstOrDefaultAsync(predicate));
        }
예제 #2
0
 public RepositoryBase(GasStationContext context)
 {
     _context = context;
     _db      = _context.Set <TEntity>();
 }