Zum Hauptinhalt springen

RtTypeWithAttributes

Namespace: Meshmakers.Octo.Runtime.Contracts.RepositoryEntities

Represents a runtime type with attributes.

public abstract class RtTypeWithAttributes

Inheritance Object → RtTypeWithAttributes

Properties​

Attributes​

Returns a dictionary of attributes.

public IReadOnlyDictionary<string, object> Attributes { get; }

Property Value​

IReadOnlyDictionary<String, Object>

Remarks:

Vor getting/setting values use the GetAttribute/SetAttribute-Methods

Methods​

GetLocation()​

Returns a string that represents a location information for error messages

protected abstract string GetLocation()

Returns​

String

ToString()​

public string ToString()

Returns​

String

GetAttributeValueOrStandard<TValue>(String, TValue)​

Gets the attribute value or the standard value if the attribute is not set. This method allows non-nullable types

public TValue GetAttributeValueOrStandard<TValue>(string attributeName, TValue standardValue)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

standardValue TValue

Returns​

TValue

GetAttributeValueOrDefault<TValue>(String, Nullable<TValue>)​

Gets the attribute value or the default value if the attribute is not set. This method allow nullable types

public Nullable<TValue> GetAttributeValueOrDefault<TValue>(string attributeName, Nullable<TValue> defaultValue)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

defaultValue Nullable<TValue>

Returns​

Nullable<TValue>

GetAttributeValues<TValue>(String)​

Gets the value of an attribute when the value is a list This method allows non-nullable types

public IAttributeValueList<TValue> GetAttributeValues<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<TValue>

GetAttributeStringValues(String)​

Gets the value of an attribute when the value is a list This method allows non-nullable types

public IAttributeValueList<string> GetAttributeStringValues(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<String>

GetRtRecordAttributeValues<TValue>(String)​

Gets the value of an attribute when the value is a list This method allows non-nullable types

public IAttributeValueList<TValue> GetRtRecordAttributeValues<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<TValue>

GetAttributeValuesOrDefault<TValue>(String)​

Gets the value of an attribute when the value is a list This method allows nullable types

public IAttributeValueList<TValue> GetAttributeValuesOrDefault<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<TValue>

GetRtRecordAttributeValuesOrDefault<TValue>(String)​

Gets the value of an attribute when the value is a list This method allows non-nullable types

public IAttributeValueList<TValue> GetRtRecordAttributeValuesOrDefault<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<TValue>

GetAttributeStringValuesOrDefault(String)​

Gets the value of an attribute when the value is a list This method allows non-nullable types

public IAttributeValueList<string> GetAttributeStringValuesOrDefault(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

IAttributeValueList<String>

GetAttributeValue<TValue>(String, TValue)​

Gets the value of an attribute when the value is non-nullable

public TValue GetAttributeValue<TValue>(string attributeName, TValue defaultValue)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

defaultValue TValue

Returns​

TValue

GetAttributeBytesValueOrDefault(String)​

Gets the byte array value of an attribute when the value is nullable

public Byte[] GetAttributeBytesValueOrDefault(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

Byte[]

GetAttributeBytesValue(String)​

Gets the byte array value of an attribute when the value is non-nullable

public Byte[] GetAttributeBytesValue(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

Byte[]

GetAttributeGeometryObjectValueOrDefault<TValue>(String)​

Gets the value of an RtRecord attribute when the value is nullable

public TValue GetAttributeGeometryObjectValueOrDefault<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

TValue

GetAttributeLinkedBinaryValueOrDefault(String)​

Gets the value of a linked binary attribute when the value is nullable

public EntityBinaryInfo GetAttributeLinkedBinaryValueOrDefault(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

EntityBinaryInfo

GetAttributeGeometryObjectValue<TValue>(String)​

Gets the value of an attribute when the value is non-nullable

public TValue GetAttributeGeometryObjectValue<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

TValue

GetAttributeLinkedBinaryValue(String)​

Gets the value of a linked binary attribute when the value is non-nullable

public EntityBinaryInfo GetAttributeLinkedBinaryValue(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

EntityBinaryInfo

GetAttributeValueOrDefault(String, Object)​

Gets the value of an attribute if the value is nullable

public object GetAttributeValueOrDefault(string attributeName, object defaultValue)

Parameters​

attributeName String
The name of the property in PascalCase

defaultValue Object

Returns​

Object

GetRtRecordAttributeValue<TValue>(String)​

Gets the value of an RtRecord attribute when the value is non-nullable

public TValue GetRtRecordAttributeValue<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

TValue

GetRtRecordAttributeValueOrDefault<TValue>(String)​

Gets the value of an RtRecord attribute when the value is non-nullable

public TValue GetRtRecordAttributeValueOrDefault<TValue>(string attributeName)

Type Parameters​

TValue

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

TValue

GetAttributeStringValueOrDefault(String, String)​

Gets the value of an attribute if the value is nullable and a string

public string GetAttributeStringValueOrDefault(string attributeName, string defaultValue)

Parameters​

attributeName String
The name of the property in PascalCase

defaultValue String

Returns​

String

GetAttributeStringValue(String)​

Gets the value of an attribute if the value is non-nullable and a string

public string GetAttributeStringValue(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

String

Exceptions​

Exception

GetAttributeSecretValueOrDefault(String)​

Gets the value of a Secret attribute (AB#5528), or null when it is not set. The value never exposes its plaintext; use ISecretAttributeProtector (or GetSecretPlaintext) server-side where the plaintext is really needed.

public RtSecretValue GetAttributeSecretValueOrDefault(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

RtSecretValue
The secret value or null

Remarks:

A plain string in the slot is a value stored before the attribute became Secret (or read by a serializer that does not know the type yet) and is returned as RtSecretValueState.LegacyPlaintext.

GetAttributeValueByAccessPath(ICkCacheService, String, IEnumerable<PathTerm>, AttributeValueResolveFlags)​

Gets the value of an attribute in the current object or an embedded document using the given path

public object GetAttributeValueByAccessPath(ICkCacheService ckCacheService, string tenantId, IEnumerable<PathTerm> path, AttributeValueResolveFlags attributeValueResolveFlags)

Parameters​

ckCacheService ICkCacheService
The cache service

tenantId String
Tenant id

path IEnumerable<PathTerm>
Path list to the attribute

attributeValueResolveFlags AttributeValueResolveFlags
Flags to control how attribute values are resolved

Returns​

Object
The value of the attribute or otherwise null

GetAttributeValueByAccessPath(ICkCacheService, String, String, AttributeValueResolveFlags)​

Gets the value of an attribute in the current object or an embedded document using the given path

public object GetAttributeValueByAccessPath(ICkCacheService ckCacheService, string tenantId, string path, AttributeValueResolveFlags attributeValueResolveFlags)

Parameters​

ckCacheService ICkCacheService
The cache service

tenantId String
Tenant id

path String
Path list to the attribute

attributeValueResolveFlags AttributeValueResolveFlags
Flags to control how attribute values are resolved

Returns​

Object
The value of the attribute or otherwise null

SetAttributeValueByAccessPath(ICkCacheService, String, IEnumerable<PathTerm>, Object)​

Sets the value of an attribute in the current object or an embedded document using the given path

public void SetAttributeValueByAccessPath(ICkCacheService ckCacheService, string tenantId, IEnumerable<PathTerm> path, object value)

Parameters​

ckCacheService ICkCacheService
The cache service

tenantId String
Tenant id

path IEnumerable<PathTerm>
Path list to the attribute

value Object
Value to set

SetAttributeValueByAccessPath(ICkCacheService, String, String, Object)​

Sets the value of an attribute in the current object or an embedded document using the given path

public void SetAttributeValueByAccessPath(ICkCacheService ckCacheService, string tenantId, string path, object value)

Parameters​

ckCacheService ICkCacheService
The cache service

tenantId String
Tenant id

path String
Path as string to the attribute

value Object
Value to set

SetAttributeValue(String, AttributeValueTypesDto, Object)​

Sets the value of an attribute when the value is nullable

public void SetAttributeValue(string attributeName, AttributeValueTypesDto attributeValueTypes, object attributeValue)

Parameters​

attributeName String
The name of the property in PascalCase

attributeValueTypes AttributeValueTypesDto
Type of attribute value

attributeValue Object
The value of the attribute

SetAttributeValueNonNullable(String, AttributeValueTypesDto, Object)​

Sets the value of an attribute when the value is non-nullable

public void SetAttributeValueNonNullable(string attributeName, AttributeValueTypesDto attributeValueTypes, object attributeValue)

Parameters​

attributeName String
The name of the property in PascalCase

attributeValueTypes AttributeValueTypesDto
Type of attribute value

attributeValue Object
The value of the attribute

SetAttributeRawValue(String, Object)​

Sets an attribute value without any type conversion. Intended for hydration paths where the raw value from the data source is assigned directly (e.g. CrateDB row dicts being poured into an StreamDataEntity).

public void SetAttributeRawValue(string attributeName, object attributeValue)

Parameters​

attributeName String

attributeValue Object

RemoveAttribute(String)​

Removes an attribute from the attribute dictionary, so a write leaves the stored value unchanged (partial update) instead of overwriting it. Used by the Secret write step (AB#5532, concept §3.6: "" means "unchanged").

internal bool RemoveAttribute(string attributeName)

Parameters​

attributeName String
The name of the property in PascalCase

Returns​

Boolean
True when the attribute was present