Ejemplo n.º 1
0
 public void Delete(Brand entity)
 {
     using (CarContext context = new CarContext())
     {
         var DeleteEntity = context.Entry(entity);
         DeleteEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public void Update(Brand entity)
 {
     using (CarContext context = new CarContext())
     {
         var UpdateEntity = context.Entry(entity);
         UpdateEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public void Update(Car item)
 {
     using (CarContext context = new CarContext())
     {
         var updateEntity = context.Entry(item);
         updateEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 4
0
 public void Add(Brand entity)
 {
     using (CarContext context = new CarContext())
     {
         var AddedEntity = context.Entry(entity);
         AddedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 public void Add(Car item)
 {
     using (CarContext context = new CarContext())
     {
         var addedEntity = context.Entry(item);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }
Ejemplo n.º 6
0
 public void Delete(Car item)
 {
     using (CarContext context = new CarContext())
     {
         var deleteToEntity = context.Entry(item);
         deleteToEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Ejemplo n.º 7
0
 public void Update(Color entity)
 {
     using (CarContext context = new CarContext())
     {
         var updateContext = context.Entry(entity);
         updateContext.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Ejemplo n.º 8
0
 public void Delete(Color entity)
 {
     using (CarContext context = new CarContext())
     {
         var deletedContext = context.Entry(entity);
         deletedContext.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Ejemplo n.º 9
0
 public void Add(Color entity)
 {
     using (CarContext context = new CarContext())
     {
         var addedContext = context.Entry(entity);
         addedContext.State = EntityState.Added;
         context.SaveChanges();
     }
 }
Ejemplo n.º 10
0
 public void Update(Car entity)
 {
     using (CarContext context = new CarContext())
     {
         var updatedEntity = context.Entry(entity);
         updatedEntity.State = EntityState.Modified;
         context.SaveChanges(); //işlemi yapar ekleme işlemini
     }
 }
Ejemplo n.º 11
0
 public void Add(Car entity)
 {
     using (CarContext context = new CarContext())
     {
         if (entity.Description.Length >= 2 && entity.DailyPrice > 0)
         {
             var addedEntity = context.Entry(entity);
             addedEntity.State = EntityState.Added;
             context.SaveChanges();
         }
         else
         {
             Console.WriteLine("Yanlış girdiniz.Tekrar deneyin");
         }
     }
 }