コード例 #1
0
    public void SaveCars(IEnumerable <Car> cars)
    {
        var changedItems = _cars.GetChangedItems().Intersect(cars);
        var newItems     = cars.Except(_cars.GetTrackedItems());

        //TODO: JET/ADO code here to create/update items above

        _cars.SetNewCheckpoint();
    }
コード例 #2
0
 public void SaveCars(IEnumerable <Car> cars)
 {
     foreach (var changedItem in _cars.GetChangedItems().Intersect(cars))
     {
         //TODO: JET/ADO code here to update the item
     }
     foreach (var newItem in cars.Except(_cars.GetTrackedItems()))
     {
         //TODO: JET/ADO code here to add the item to the DB and get its new ID
         int newId = 5;
         _cars.StartTracking(newId, newItem);
     }
     _cars.SetNewCheckpoint();
 }