Example #1
0
        protected override void DoCommit()
        {
            var modifiedObjects = GetObjectsByState(InstanceState.New, InstanceState.Changed);
            var deletedObjects  = GetObjectsByState(InstanceState.Deleted);

            IList refreshedObjects = persistenceManager.UpdateObjects(modifiedObjects, deletedObjects);

            foreach (var obj in deletedObjects)
            {
                instances.Remove(obj);
            }

            for (int i = 0; i < modifiedObjects.Count; i++)
            {
                RefreshObject(modifiedObjects[i], refreshedObjects[i]);
                instances[modifiedObjects[i]].State = InstanceState.Unchanged;
            }
        }