Class TracksChangesEntityBase
A base class for use to implement IRememberBeingDirty/ICanBeDirty
Inheritance
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public abstract class TracksChangesEntityBase : IRememberBeingDirty, ICanBeDirty
Methods
DisableChangeTracking()
Declaration
public void DisableChangeTracking()
EnableChangeTracking()
Declaration
public void EnableChangeTracking()
ForgetPreviouslyDirtyProperties()
Resets the remembered dirty properties from before the last commit
Declaration
public void ForgetPreviouslyDirtyProperties()
GetDirtyProperties()
Declaration
public virtual IEnumerable<string> GetDirtyProperties()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
IsDirty()
Indicates whether the current entity is dirty.
Declaration
public virtual bool IsDirty()
Returns
Type | Description |
---|---|
System.Boolean | True if entity is dirty, otherwise False |
IsPropertyDirty(String)
Indicates whether a specific property on the current entity is dirty.
Declaration
public virtual bool IsPropertyDirty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to check |
Returns
Type | Description |
---|---|
System.Boolean | True if Property is dirty, otherwise False |
OnPropertyChanged(PropertyInfo)
Method to call on a property setter.
Declaration
protected virtual void OnPropertyChanged(PropertyInfo propertyInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | propertyInfo | The property info. |
ResetChangeTrackingCollections()
Declaration
public void ResetChangeTrackingCollections()
ResetDirtyProperties()
Resets dirty properties by clearing the dictionary used to track changes.
Declaration
public virtual void ResetDirtyProperties()
Remarks
Please note that resetting the dirty properties could potentially obstruct the saving of a new or updated entity.
ResetDirtyProperties(Boolean)
Resets dirty properties by clearing the dictionary used to track changes.
Declaration
public virtual void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | rememberPreviouslyChangedProperties | true if we are to remember the last changes made after resetting |
Remarks
Please note that resetting the dirty properties could potentially obstruct the saving of a new or updated entity.
WasDirty()
Indicates that the entity had been changed and the changes were committed
Declaration
public virtual bool WasDirty()
Returns
Type | Description |
---|---|
System.Boolean |
WasPropertyDirty(String)
Indicates whether a specific property on the current entity was changed and the changes were committed
Declaration
public virtual bool WasPropertyDirty(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property to check |
Returns
Type | Description |
---|---|
System.Boolean | True if Property was changed, otherwise False. Returns false if the entity had not been previously changed. |
Events
PropertyChanged
Property changed event
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |