public GenericRepository(MusicDBContext context) { _context = context; _entities = _context.Set <T>(); }
public MusicRepository() { dbContext = new MusicDBContext(); db = dbContext.Set <T>(); }
public async Task Add(TEntity entity) { await db.Set <TEntity>().AddAsync(entity); await db.SaveChangesAsync(); }