public T Update <T>(T model) where T : class { using (UrunTakipContext urunTakipContext = new UrunTakipContext()) { urunTakipContext.Set <T>().Update(model); urunTakipContext.SaveChanges(); } return(model); }
public void Delete <T>(int id) where T : class { T model = Find <T>(id); using (UrunTakipContext urunTakipContext = new UrunTakipContext()) { urunTakipContext.Set <T>().Remove(model); urunTakipContext.SaveChanges(); } }