internal List <viewT> FetchAll() { return(_db.Set <dbT>().OrderBy(r => r.Id).ToList().Adapt <List <viewT> >()); }
public CustomersRepository(EfDataContext context) { _efDataContext = context ?? throw new ArgumentNullException(nameof(context)); DbSet = _efDataContext.Set <Customer>(); }
public virtual void Add(TEntity obj) { _Db.Set <TEntity>().Add(obj); _Db.SaveChanges(); }
public async ValueTask <TEntity> GetByIdAsync(int id) { return(await _context.Set <TEntity>().FindAsync(id)); }