public void Delete(Brand entity) { using (CarContext context = new CarContext()) { var DeleteEntity = context.Entry(entity); DeleteEntity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Update(Brand entity) { using (CarContext context = new CarContext()) { var UpdateEntity = context.Entry(entity); UpdateEntity.State = EntityState.Modified; context.SaveChanges(); } }
public void Update(Car item) { using (CarContext context = new CarContext()) { var updateEntity = context.Entry(item); updateEntity.State = EntityState.Modified; context.SaveChanges(); } }
public void Add(Brand entity) { using (CarContext context = new CarContext()) { var AddedEntity = context.Entry(entity); AddedEntity.State = EntityState.Added; context.SaveChanges(); } }
public void Add(Car item) { using (CarContext context = new CarContext()) { var addedEntity = context.Entry(item); addedEntity.State = EntityState.Added; context.SaveChanges(); } }
public void Delete(Car item) { using (CarContext context = new CarContext()) { var deleteToEntity = context.Entry(item); deleteToEntity.State = EntityState.Deleted; context.SaveChanges(); } }
public void Update(Color entity) { using (CarContext context = new CarContext()) { var updateContext = context.Entry(entity); updateContext.State = EntityState.Modified; context.SaveChanges(); } }
public void Delete(Color entity) { using (CarContext context = new CarContext()) { var deletedContext = context.Entry(entity); deletedContext.State = EntityState.Deleted; context.SaveChanges(); } }
public void Add(Color entity) { using (CarContext context = new CarContext()) { var addedContext = context.Entry(entity); addedContext.State = EntityState.Added; context.SaveChanges(); } }
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 } }
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"); } } }