Skip to main content

Definition

Assembly: CloudNimble.EasyAF.Core.dll Namespace: CloudNimble.EasyAF.Core Inheritance: CloudNimble.EasyAF.Core.EasyObservableObject

Syntax

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-object

Constructors

.ctor

Syntax

.ctor Inherited

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Initializes a new instance of the EasyObservableObject class.

Syntax

.ctor Inherited

Inherited from object

Syntax

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.EasyObservableObject
Provides access to the PropertyChanged event handler to derived classes.

Syntax

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, call Boolean). PropertyChanged events will still be fired, regardless of this setting.

Methods

AcceptChanges

Clears the DbObservableObject.OriginalValues list and sets DbObservableObject.IsChanged to false.

Syntax

AcceptChanges

Clears the DbObservableObject.OriginalValues list and sets DbObservableObject.IsChanged to false, and optionally traverses the object graph to call DbObservableObject.AcceptChanges on any children.

Syntax

Parameters

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.EasyObservableObject
Creates a deep copy of the current object using JSON serialization.

Syntax

Returns

Type: T A new instance of type T that is a deep copy of the current object.

Type Parameters

Exceptions

Dispose Inherited Virtual

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Releases the unmanaged resources used by the EasyObservableObject and optionally releases the managed resources.

Syntax

Parameters

Dispose Inherited

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Syntax

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

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 object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

RaisePropertyChanged Inherited Virtual

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Raises the PropertyChanged event if needed.

Syntax

Parameters

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.EasyObservableObject
Raises the PropertyChanged event if needed.

Syntax

Parameters

Type Parameters

  • T - The type of the property that changed.

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

RejectChanges

Loops through the DbObservableObject.OriginalValues list, sets any property that has changed back to the value it had when Boolean) was called, clears the DbObservableObject.OriginalValues list, and sets DbObservableObject.IsChanged to false.

Syntax

RejectChanges

Syntax

Parameters

Set Inherited

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Assigns a new value to the property. Then, raises the PropertyChanged event if needed.

Syntax

Parameters

Type Parameters

  • T - The type of the property that changed.

Set Inherited Virtual

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Assigns a new value to the property. Then, raises the PropertyChanged event if needed.

Syntax

Parameters

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

Returns

Type: System.Dynamic.ExpandoObject An ExpandoObject containing JUST the new values for the properties that changed.

Remarks

If the object implements IIdentifiable1`, then the payload will always include the ID.

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?

TrackChanges

Starts tracking property value changes for every property, optionally activating this behavior for the entire object graph.

Syntax

Parameters

Events

PropertyChanged Inherited

Inherited from CloudNimble.EasyAF.Core.EasyObservableObject
Occurs when a property value changes.

Syntax

  • System.ComponentModel.INotifyPropertyChanged
  • System.IDisposable
  • System.ComponentModel.IChangeTracking
  • System.ComponentModel.IRevertibleChangeTracking