Skip to main content

CkAttributeDto

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.DataTransferObjects

Represents an attribute

public class CkAttributeDto

Inheritance Object → CkAttributeDto

Properties​

AttributeId​

The id of the attribute

public CkAttributeId AttributeId { get; set; }

Property Value​

CkAttributeId

ValueType​

Value type of the attribute

public AttributeValueTypesDto ValueType { get; set; }

Property Value​

AttributeValueTypesDto

ValueCkRecordId​

Defines the record of the attribute if the value type is a record.

public CkId<CkRecordId> ValueCkRecordId { get; set; }

Property Value​

CkId<CkRecordId>

ValueCkEnumId​

Defines the enum of the attribute if the value type is a enum.

public CkId<CkEnumId> ValueCkEnumId { get; set; }

Property Value​

CkId<CkEnumId>

DefaultValues​

Default value of the attribute

public ICollection<object> DefaultValues { get; set; }

Property Value​

ICollection<Object>

Ownership​

Declares who owns this attribute's value and whether the value is portable — see AttributeOwnershipDto for the four values and the author decision matrix. This is the DEFAULT for every assignment of this attribute; a type-attribute or record-attribute assignment may override it via CkTypeAttributeDto.Ownership. null (omitted) means "not declared": the deprecated CkAttributeDto.IsRuntimeState alias is used instead, which is what every model authored before AB#5187 does.

public Nullable<AttributeOwnershipDto> Ownership { get; set; }

Property Value​

Nullable<AttributeOwnershipDto>

IsRuntimeState​

DEPRECATED alias for CkAttributeDto.Ownership, kept so every model authored before AB#5187 compiles and behaves exactly as before. Declaring isRuntimeState: true resolves to AttributeOwnershipDto.RuntimeState, declaring false or omitting it resolves to AttributeOwnershipDto.SeedOwned.

public bool IsRuntimeState { get; set; }

Property Value​

Boolean

Remarks:

Once CkAttributeDto.Ownership is declared this property stops being an input and becomes a computed MIRROR of it, meaning "preserved on Upsert" (AttributeOwnership.IsPreservedOnUpsert(AttributeOwnershipDto)) — true for AttributeOwnershipDto.TenantOwned, AttributeOwnershipDto.RuntimeState and AttributeOwnershipDto.Secret. The mirror is what makes version skew safe: it is serialised into the compiled model and persisted by the CK-model repository, so an engine that does not yet know ownership reads a tenant-owned or secret attribute as isRuntimeState: true and degrades to today's behaviour (preserve + exclude from export) instead of regressing to "seed wins", which would reset credentials.

Declaring both ownership and isRuntimeState on the same attribute is an authoring error the CkLintRuntimeStateMarkers MSBuild task rejects (OCTO-CK003). The engine resolves it deterministically anyway: ownership wins.

Description​

An optional description of the attribute

public string Description { get; set; }

Property Value​

String

MetaData​

Optional meta data of the attribute

public ICollection<CkAttributeMetaDataDto> MetaData { get; set; }

Property Value​

ICollection<CkAttributeMetaDataDto>

Constructors​

CkAttributeDto()​

public CkAttributeDto()