Definition
Assembly: CloudNimble.EasyAF.Core.dll Namespace: CloudNimble.EasyAF.Core Inheritance: CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Summary
A base class for Entity Framework objects to implement INotifyPropertyChanged, IChangeTracking, and IRevertibleChangeTracking in front-end development.Remarks
https://stackoverflow.com/questions/2363801/what-would-be-the-best-way-to-implement-change-tracking-on-an-objectConstructors
.ctor
Syntax
.ctor Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
.ctor Inherited
Inherited from
objectSyntax
Properties
IsChanged
Specifies whether or not the object has changed.Syntax
Property Value
Type:bool
Remarks
Setting this manually allows you to override the default behavior in case your app needs it.IsGraphChanged
Syntax
Property Value
Type:bool
OriginalValues
Syntax
Property Value
Type:System.Collections.Generic.Dictionary<string, object>
PropertyChangedHandler Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Property Value
Type:System.ComponentModel.PropertyChangedEventHandler
ShouldTrackChanges
Specifies whether or not property value changes should be tracked.Syntax
Property Value
Type:bool
Remarks
To track changes, callBoolean). PropertyChanged events will still be fired, regardless of this setting.
Methods
AcceptChanges
Clears the DbObservableObject.OriginalValues list and sets DbObservableObject.IsChanged tofalse.
Syntax
AcceptChanges
Clears the DbObservableObject.OriginalValues list and sets DbObservableObject.IsChanged tofalse, and optionally traverses the object graph to call DbObservableObject.AcceptChanges on any children.
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
goDeep | bool | - |
ClearRelationships
Sets any child relationships (0..1:1 or 1:*) to null.Syntax
Remarks
This is typically used to clean an entity before it is POSTed or PUT over an OData API.Clone Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Returns
Type:T
A new instance of type T that is a deep copy of the current object.
Type Parameters
T- The type of object to clone. Must inherit from EasyObservableObject.
Exceptions
| Exception | Description |
|---|---|
JsonException | Thrown when the object cannot be serialized or deserialized. |
Dispose Inherited Virtual
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
disposing | bool | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Dispose Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetRelatedEntityCollectionProperties
Syntax
Returns
Type:System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>
GetRelatedEntityProperties
Syntax
Returns
Type:System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo>
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
RaisePropertyChanged Inherited Virtual
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the property that changed. |
Remarks
If the propertyName parameter does not correspond to an existing property on the current class, an exception is thrown in DEBUG configuration only.RaisePropertyChanged Inherited Virtual
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyExpression | System.Linq.Expressions.Expression<System.Func<T>> | An expression identifying the property that changed. |
Type Parameters
T- The type of the property that changed.
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
RejectChanges
Loops through the DbObservableObject.OriginalValues list, sets any property that has changed back to the value it had whenBoolean) was called,
clears the DbObservableObject.OriginalValues list, and sets DbObservableObject.IsChanged to false.
Syntax
RejectChanges
Syntax
Parameters
| Name | Type | Description |
|---|---|---|
goDeep | bool | - |
Set Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyExpression | System.Linq.Expressions.Expression<System.Func<T>> | An expression identifying the property that changed. |
field | T | The field storing the property’s value. |
newValue | T | The property’s value after the change occurred. |
Type Parameters
T- The type of the property that changed.
Set Inherited Virtual
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
propertyName | string | The name of the property that changed. |
field | T | The field storing the property’s value. |
newValue | T | The property’s value after the change occurred. |
Type Parameters
T- The type of the property that changed.
ToDeltaPayload
Loops through the keys in the DbObservableObject.OriginalValues list and returns an ExpandoObject containing JUST the new values for the properties that changed.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
deepTracking | bool | - |
Returns
Type:System.Dynamic.ExpandoObject
An ExpandoObject containing JUST the new values for the properties that changed.
Remarks
If the object implementsIIdentifiable1`, then the payload will always include the ID.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
TrackChanges
Starts tracking property value changes for every property, optionally activating this behavior for the entire object graph.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
deepTracking | bool | When true, loops recursively through the object graph and calls Boolean) on every object that |
| inherits from EasyObservableObject. |
Events
PropertyChanged Inherited
Inherited from
CloudNimble.EasyAF.Core.EasyObservableObjectSyntax
Related APIs
- System.ComponentModel.INotifyPropertyChanged
- System.IDisposable
- System.ComponentModel.IChangeTracking
- System.ComponentModel.IRevertibleChangeTracking