public void Sil(Product product) { using (EtradeContext context = new EtradeContext()) { var entity = context.Entry(product); entity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Guncelle(Product product) { using (EtradeContext context = new EtradeContext()) { var entity = context.Entry(product); entity.State = EntityState.Modified; context.SaveChanges(); } }