Class EntityKernel
The dynamic core of an entity.
[DataContract]
public sealed class EntityKernel : IHasChanges
- Inheritance
-
EntityKernel
- Implements
- Inherited Members
Remarks
Entity kernels consist logically of:
- an ID
- a databinding context
- attributes and metadata injected by generated code
Fields
Attributes
[DataMember]
public readonly AttributeBase[] Attributes
Field Value
Context
public readonly IEntityContext Context
Field Value
Relationships
public readonly RelationshipProperty[] Relationships
Field Value
Wrapper
public readonly IEntity Wrapper
Field Value
Properties
ID
public Guid ID { get; }
Property Value
Metadata
public IEntityInfo Metadata { get; }
Property Value
State
public RowState State { get; }
Property Value
Text
public string Text { get; }
Property Value
active
public bool active { get; set; }
Property Value
createdBy
public string createdBy { get; }
Property Value
createdOn
public DateTimeOffset createdOn { get; }
Property Value
modifiedBy
public string modifiedBy { get; }
Property Value
modifiedOn
public DateTimeOffset modifiedOn { get; }
Property Value
version
public ulong version { get; set; }
Property Value
Methods
CalculateAsync()
public Task CalculateAsync()
Returns
Clone(IEntityContext, CloneState?)
Copy the graph rooted at this entity into another context, overwriting data already present
public EntityKernel Clone(IEntityContext context, CloneState? state = null)
Parameters
contextIEntityContextTarget context, destructively updated
stateCloneStateSet of entity IDs already copied
Returns
- EntityKernel
Differently-contextualised version of this entity
Copy(IEntityContext)
public EntityKernel Copy(IEntityContext context)
Parameters
contextIEntityContext
Returns
HasAttributeChanges()
public bool HasAttributeChanges()
Returns
HasChanges()
true if the current value differs from its original
public bool HasChanges()
Returns
MarkDeleted()
public void MarkDeleted()
MarkUnchanged()
update original data so that it's no longer considered changed
public void MarkUnchanged()
NeedsSave()
true if the value has non-derived changes, ones made deliberately by a user or business logic
public bool NeedsSave()
Returns
PruneAsync(BreakRelationships, CancellationToken?)
public Task PruneAsync(BreakRelationships relationships, CancellationToken? cancellationToken = null)
Parameters
relationshipsBreakRelationshipscancellationTokenCancellationToken?
Returns
PruneLoaded(BreakRelationships)
public void PruneLoaded(BreakRelationships relationships)
Parameters
relationshipsBreakRelationships
SaveAsync(CancellationToken?)
public Task<SaveResult> SaveAsync(CancellationToken? cancellationToken = null)
Parameters
cancellationTokenCancellationToken?
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.