Table of Contents

Class EntityReferenceProperty

Namespace
The.Relationships
Assembly
Instagile.dll
public abstract class EntityReferenceProperty : RelationshipProperty, ILazy, IOwnedValue<IEntity?>, IValue<IEntity?>, INotifyValueChanged, IProperty, IOwned, IHasChanges
Inheritance
EntityReferenceProperty
Implements
Derived
Inherited Members
Extension Methods

Constructors

EntityReferenceProperty(RelationshipInfo, EntityKernel)

public EntityReferenceProperty(RelationshipInfo metadata, EntityKernel parent)

Parameters

metadata RelationshipInfo
parent EntityKernel

Properties

CacheState

The cache state of the most recent GetCachedAsync call. Uncached if never loaded via GetCachedAsync or if loaded synchronously.

public ResultState CacheState { get; protected set; }

Property Value

ResultState

HasValue

Gets a value indicating whether the reference has a non-null value. Does not require or force the property to be present.

public virtual bool HasValue { get; }

Property Value

bool

ID

public Guid? ID { get; }

Property Value

Guid?

IsDefaulted

true if the data is a system default rather than user-entered

public bool IsDefaulted { get; set; }

Property Value

bool

IsInitialised

public override sealed bool IsInitialised { get; }

Property Value

bool

IsPresent

True if fully loaded, false if partially or fully unloaded.

public override bool IsPresent { get; }

Property Value

bool

OriginalValue

public IEntity? OriginalValue { get; }

Property Value

IEntity

Value

read/write underlying data

public IEntity? Value { get; set; }

Property Value

IEntity

Methods

GetCurrentKernels()

protected override IEnumerable<RelationshipKernel> GetCurrentKernels()

Returns

IEnumerable<RelationshipKernel>

GetOriginalKernels()

protected override IEnumerable<RelationshipKernel> GetOriginalKernels()

Returns

IEnumerable<RelationshipKernel>

GetRelatedEntityCachedAsync(Guid, RequestOptions, CancellationToken?)

protected abstract Task<IEntity?> GetRelatedEntityCachedAsync(Guid id, RequestOptions options, CancellationToken? cancellationToken)

Parameters

id Guid
options RequestOptions
cancellationToken CancellationToken?

Returns

Task<IEntity>

GetText()

A textual representation of the underlying value, rather than the IValue itself.

public string GetText()

Returns

string

InternalAddCurrent(Mutation, RelationshipKernel)

protected override bool InternalAddCurrent(Mutation m, RelationshipKernel kernel)

Parameters

m Mutation
kernel RelationshipKernel

Returns

bool

InternalAddOriginal(RelationshipKernel)

protected override void InternalAddOriginal(RelationshipKernel kernel)

Parameters

kernel RelationshipKernel

InternalCopy(Mutation, RelationshipProperty, RelationshipProperty, bool, CloneState)

protected override void InternalCopy(Mutation m, RelationshipProperty from, RelationshipProperty to, bool cloneEntities, CloneState state)

Parameters

m Mutation
from RelationshipProperty
to RelationshipProperty
cloneEntities bool
state CloneState

InternalHasChanges(bool)

protected override bool InternalHasChanges(bool ignoreDerived)

Parameters

ignoreDerived bool

Returns

bool

InternalRemoveCurrent(Mutation, RelationshipKernel)

protected override bool InternalRemoveCurrent(Mutation m, RelationshipKernel kernel)

Parameters

m Mutation
kernel RelationshipKernel

Returns

bool

InternalRemoveOriginal(Mutation, RelationshipKernel)

protected override bool InternalRemoveOriginal(Mutation m, RelationshipKernel kernel)

Parameters

m Mutation
kernel RelationshipKernel

Returns

bool

LazyLoad(Mutation)

protected override void LazyLoad(Mutation m)

Parameters

m Mutation

LazyLoadAsync(Mutation, CancellationToken?)

protected override Task LazyLoadAsync(Mutation m, CancellationToken? cancellationToken)

Parameters

m Mutation
cancellationToken CancellationToken?

Returns

Task

LazyLoadCachedAsync(Mutation, RequestOptions, CancellationToken?)

protected Task LazyLoadCachedAsync(Mutation m, RequestOptions options, CancellationToken? cancellationToken)

Parameters

m Mutation
options RequestOptions
cancellationToken CancellationToken?

Returns

Task

MarkUnchanged()

update original data so that it's no longer considered changed

public override void MarkUnchanged()

OnCacheUpdate(IEntity?)

protected void OnCacheUpdate(IEntity? relatedEntity)

Parameters

relatedEntity IEntity

SetDefaulted()

clear any user-entered data and return to system defaults

public void SetDefaulted()

Unload(RelationshipKernel)

protected override void Unload(RelationshipKernel forgottenKernel)

Parameters

forgottenKernel RelationshipKernel

Events

ValueChanged

public event EventHandler? ValueChanged

Event Type

EventHandler