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

            await db.SaveChangesAsync();
        }