public void PersistChanges() { using (InventoryDal inventory = (new InventoryDal())) { foreach (var car in Cars) { if (car.IsChanged) { inventory.UpdateCar(ModelTransformations.InventoryToCar(car)); } } } }