public async Task <IEnumerable <Artist> > GetArtistsAsync(int pageIndex = 1, int pageSize = 10)
        {
            IQueryable <Artist> query = _context.Set <Artist>();

            var result = query
                         //.Include(a => a.Artistbasicinfo)
                         .Skip((pageIndex - 1) * pageSize)
                         .Take(pageSize)
                         .AsNoTracking();

            return(await result.ToListAsync());
        }
 public GenericRepository(MusicStoreDbContext db)
 {
     this.db    = db;
     this.table = db.Set <T>();
 }
Пример #3
0
 public void Create(T entity) => _context.Set <T>().Add(entity);
 public GenericRepository()
 {
     this.db    = new MusicStoreDbContext();
     this.table = db.Set <T>();
 }