Beispiel #1
0
 public void Ekle(Order order) //Model Binding
 {
     using (EMarketContext context = new EMarketContext())
     {
         context.Orders.Add(order);
         context.SaveChanges();
     }
 }
Beispiel #2
0
 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();
     }
 }
Beispiel #4
0
 public void Guncelle(Order order)
 {
     using (EMarketContext context = new EMarketContext())
     {
         var entity = context.Entry(order);
         entity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Beispiel #5
0
 public void Sil(Order order)
 {
     using (EMarketContext context = new EMarketContext())
     {
         var entity = context.Entry(order);
         entity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #6
0
 public void Sil(Product product)
 {
     using (EMarketContext context = new EMarketContext())
     {
         var entity = context.Entry(product);
         entity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Beispiel #7
0
 public void Guncelle(Product product) //Model Binding
 {
     using (EMarketContext context = new EMarketContext())
     {
         var entity = context.Entry(product);
         entity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }