public void Update(TEntity table) { using var context = new YoutubeContext(); context.Set <TEntity>().Update(table); context.SaveChanges(); }
public List <TEntity> getAll() { using var context = new YoutubeContext(); return(context.Set <TEntity>().OrderByDescending(c => c.Id).ToList()); }
public Tablo GetirIdile(int id) { using var context = new YoutubeContext(); return(context.Set <Tablo>().Find(id)); }
public List <Tablo> HepsiniGetir() { using var context = new YoutubeContext(); return(context.Set <Tablo>().ToList()); }
public void Sil(Tablo tablo) { using var context = new YoutubeContext(); context.Set <Tablo>().Remove(tablo); context.SaveChanges(); }
public void Guncelle(Tablo tablo) { using var context = new YoutubeContext(); context.Set <Tablo>().Update(tablo); context.SaveChanges(); }
public void Ekle(Tablo tablo) { using var context = new YoutubeContext(); context.Set <Tablo>().Add(tablo); context.SaveChanges(); }