private void BackupProposedValueIfNeeded(DataProperty property, Object oldValue) { if (_preproposedValuesMap == null) { _preproposedValuesMap = new BackupValuesMap(); } else { if (_preproposedValuesMap.ContainsKey(property.Name)) { return; } } _preproposedValuesMap.Add(property.Name, oldValue); }
private void BackupOriginalValueIfNeeded(DataProperty property, Object oldValue) { if (_originalValuesMap == null) { _originalValuesMap = new BackupValuesMap(); } else { if (_originalValuesMap.ContainsKey(property.Name)) { return; } } // reference copy of complex object is deliberate - actual original values will be stored in the co itself. _originalValuesMap.Add(property.Name, oldValue); }
internal virtual void RestoreOriginalValues(BackupValuesMap backupMap, EntityVersion version) { backupMap.ForEach(kvp => { var value = kvp.Value; if (value is IComplexObject) { ((IComplexObject)value).ComplexAspect.RestoreBackupVersion(version); } var dp = this.StructuralType.GetDataProperty(kvp.Key); if (GetValue(dp) != value) { SetDpValue(dp, value); OnDataPropertyRestore(dp); } }); }
private ReadOnlyDictionary <String, Object> HandleNull(BackupValuesMap map) { return((map ?? BackupValuesMap.Empty).ReadOnlyDictionary); }