Exemplo n.º 1
0
 public void Update(Entities.Concrete.Product entity)
 {
     using (NorthwindContext context = new NorthwindContext())
     {
         var updatedEntity = context.Entry(entity);
         updatedEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public void Add(Entities.Concrete.Product entity)
 {
     //Belleği hızlıca temizleme
     using (NorthwindContext context = new NorthwindContext())
     {
         var addedEntity = context.Entry(entity);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }