Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.Testing.Parent Class Reference

A Parent model for demonstrating SuperModel and associations (with Child). Not a human parent. More...

Inheritance diagram for Buzzware.Cascade.Testing.Parent:
Buzzware.Cascade.SuperModel

Public Member Functions

 Parent ()
 Parent Constructor.
Parent withChanges (string? colour=null, string? size=null, long? updatedAtMs=null)
 Creates a new Parent object with the same id, and optionally modified values for colour, size, and updatedAtMs. If these are not provided, the current object's values will be used.
Public Member Functions inherited from Buzzware.Cascade.SuperModel
 SuperModel (SuperModel? proxyFor=null)
 Initializes a new instance of the SuperModel with an optional proxy model.
void __SetProxyFor (SuperModel? value, bool keepChanges, bool raiseIncoming)
 Sets a new proxy model and optionally retains changes or raises property change events.
IDictionary< string, object?> __GetChanges ()
 When acting as a proxy to another object, this method returns changes that have been made on this object vs the proxied object.
void __ApplyChanges (IDictionary< string, object?> changes)
 Applies a set of changes to the properties of the model.
void __ClearChanges ()
 Clears all changes made to the model, resetting the property state to the proxy model values.
void __mutateWith (Action< SuperModel > action)
 Executes an action that mutates the model, restoring the original mutation state afterwards.
void RaisePropertyChanged ([CallerMemberName] string propertyName=null)
 Raises a property changed notification for the specified property name.
SuperModel Clone (IDictionary< string, object?>? changes=null)
 Creates a shallow copy of the current SuperModel, optionally applying additional property changes.

Properties

long id [get, set]
 The unique identifier.
IEnumerable< Child >? Children [get, set]
 Represents a collection of Child entities associated with this Parent. It is mapped by a foreign key relationship based on the parentId property.
string? colour [get, set]
string? Size [get, set]
long updatedAtMs [get, set]
 Timestamp, in milliseconds, when the Parent entity was last updated.
Properties inherited from Buzzware.Cascade.SuperModel
bool __mutable [get, set]
 Gets or sets the mutable state of the model. When false, attempting to modify properties will throw a MutationAttemptException.
SuperModel__ProxyFor [get]
 The proxy model that this model is currently proxying for, if any.
bool __HasChanges [get]
 True if there are any uncommitted property changes in this model.

Additional Inherited Members

Protected Member Functions inherited from Buzzware.Cascade.SuperModel
bool SetProperty< T > (ref T backingStore, T value, [CallerMemberName] string propertyName="", Action onChanged=null)
 Sets a property value and raises property change notifications if the value has changed.
GetProperty< T > (ref T backingStore, [CallerMemberName] string propertyName="", Action onChanged=null)
 Gets a property value, taking into account whether it's overridden by a proxy.
virtual void OnPropertyChanged (PropertyChangedEventArgs args)
 Raises the PropertyChanged event with the provided arguments.
void OnProxyForOnPropertyChanged (object sender, PropertyChangedEventArgs e)
 Handles property change events from the proxy model and re-raises them for this model.
Protected Attributes inherited from Buzzware.Cascade.SuperModel
SuperModel_proxyFor
readonly ConcurrentDictionary< string, bool > _propertySet = new ConcurrentDictionary<string, bool>()
Events inherited from Buzzware.Cascade.SuperModel
PropertyChangedEventHandler? PropertyChanged

Detailed Description

A Parent model for demonstrating SuperModel and associations (with Child). Not a human parent.

Member Function Documentation

◆ withChanges()

Parent Buzzware.Cascade.Testing.Parent.withChanges ( string? colour = null,
string? size = null,
long? updatedAtMs = null )
inline

Creates a new Parent object with the same id, and optionally modified values for colour, size, and updatedAtMs. If these are not provided, the current object's values will be used.

Parameters
colourcolour
sizesize
updatedAtMsupdatedAtMs
Returns
A new Parent object with specified or existing values.

The documentation for this class was generated from the following file:
  • Buzzware.Cascade/Testing/Parent.cs