EntityUpdateInfo<TEntity>
Namespace: Meshmakers.Octo.Runtime.Contracts
Represents an entity update info.
public class EntityUpdateInfo<TEntity> : IEntityUpdateInfo<TEntity>
Type Parameters
TEntity
Inheritance Object → EntityUpdateInfo<TEntity>
Implements IEntityUpdateInfo<TEntity>
Properties
RtEntity
public TEntity RtEntity { get; }
Property Value
TEntity
RtId
public Nullable<OctoObjectId> RtId { get; }
Property Value
CkTypeId
public RtCkId<CkTypeId> CkTypeId { get; }
Property Value
RtCkId<CkTypeId>
ModOption
MOD option.
public EntityModOptions ModOption { get; }
Property Value
UpdateGuard
public AttributeNewerThanGuard UpdateGuard { get; }
Property Value
Remarks:
Not serialized — the guard is meaningful only in-process at write time, not on the wire. Cross-process consumers should call EntityUpdateInfo<TEntity>.CreateConditionalUpdate(RtEntityId, TEntity, AttributeNewerThanGuard) themselves if they need OCC.
ClearSecretAttributes
public IReadOnlyCollection<string> ClearSecretAttributes { get; }
Property Value
Remarks:
Serialized (both Newtonsoft and System.Text.Json) so the clear list survives a hop between processes; omitted from the wire when not set.
Methods
GetRtEntityId()
public RtEntityId GetRtEntityId()
Returns
RtEntityId
CreateInsert(RtCkId<CkTypeId>, TEntity)
Creates a new instance of EntityUpdateInfo<TEntity> for insert.
public static EntityUpdateInfo<TEntity> CreateInsert(RtCkId<CkTypeId> ckTypeId, TEntity rtEntity)
Parameters
ckTypeId RtCkId<CkTypeId>
Type identifier of the construction kit
rtEntity TEntity
Runtime entity to insert
Returns
CreateInsert(TEntity)
Creates a new instance of EntityUpdateInfo<TEntity> for insert.
public static EntityUpdateInfo<TEntity> CreateInsert(TEntity rtEntity)
Parameters
rtEntity TEntity
Runtime entity to insert
Returns
CreateDelete(RtEntityId)
Creates a new instance of EntityUpdateInfo<TEntity> for delete.
public static EntityUpdateInfo<TEntity> CreateDelete(RtEntityId rtEntityId)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
Returns
CreateUpdate(RtEntityId, TEntity)
Creates a new instance of EntityUpdateInfo<TEntity> for update.
public static EntityUpdateInfo<TEntity> CreateUpdate(RtEntityId rtEntityId, TEntity rtEntity)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
rtEntity TEntity
Runtime entity to update
Returns
CreateConditionalUpdate(RtEntityId, TEntity, AttributeNewerThanGuard)
Creates a new instance of EntityUpdateInfo<TEntity> for a
conditional update guarded by updateGuard. The write is
applied only if the persisted value at AttributeNewerThanGuard.AttributePath
is missing, null, or less than or equal to
AttributeNewerThanGuard.NewValue. Otherwise the write is silently
skipped — the caller can detect this via the matched-count returned from the
repository.
public static EntityUpdateInfo<TEntity> CreateConditionalUpdate(RtEntityId rtEntityId, TEntity rtEntity, AttributeNewerThanGuard updateGuard)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
rtEntity TEntity
Runtime entity to update
updateGuard AttributeNewerThanGuard
Guard that gates the write — see AttributeNewerThanGuard
Returns
CreateUpdate(RtEntityId, TEntity, IEnumerable<String>)
Creates a new instance of EntityUpdateInfo<TEntity> for update that also clears
the listed Secret attributes (AB#5532, see EntityUpdateInfo<TEntity>.ClearSecretAttributes).
public static EntityUpdateInfo<TEntity> CreateUpdate(RtEntityId rtEntityId, TEntity rtEntity, IEnumerable<string> clearSecretAttributes)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
rtEntity TEntity
Runtime entity to update (may carry no attributes when only clearing)
clearSecretAttributes IEnumerable<String>
Names (PascalCase) of the Secret attributes to clear
Returns
CreateReplace(RtEntityId, TEntity)
Creates a new instance of EntityUpdateInfo<TEntity> for replace.
public static EntityUpdateInfo<TEntity> CreateReplace(RtEntityId rtEntityId, TEntity rtEntity)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
rtEntity TEntity
Runtime entity to replace
Returns
CreateReplace(RtEntityId, TEntity, IEnumerable<String>)
Creates a new instance of EntityUpdateInfo<TEntity> for replace that also clears
the listed Secret attributes (AB#5532). Without a clear entry a replace keeps a stored
secret the incoming entity omits or sends as "".
public static EntityUpdateInfo<TEntity> CreateReplace(RtEntityId rtEntityId, TEntity rtEntity, IEnumerable<string> clearSecretAttributes)
Parameters
rtEntityId RtEntityId
Runtime entity identifier for runtime id and construction kit type
rtEntity TEntity
Runtime entity to replace
clearSecretAttributes IEnumerable<String>
Names (PascalCase) of the Secret attributes to clear