public void Ekle(Order order) //Model Binding { using (EMarketContext context = new EMarketContext()) { context.Orders.Add(order); context.SaveChanges(); } }
public void Ekle(Product product) //Model Binding { using (EMarketContext context = new EMarketContext()) { context.Products.Add(product); context.SaveChanges(); } }
public void Ekle(User user) { using (EMarketContext context = new EMarketContext()) { context.Users.Add(user); context.SaveChanges(); } }
public void Guncelle(Order order) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(order); entity.State = EntityState.Modified; context.SaveChanges(); } }
public void Sil(Order order) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(order); entity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Sil(Product product) { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(product); entity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Guncelle(Product product) //Model Binding { using (EMarketContext context = new EMarketContext()) { var entity = context.Entry(product); entity.State = EntityState.Modified; context.SaveChanges(); } }