Skip to main content

RtTypeWithAttributes

Namespace: Meshmakers.Octo.Runtime.Contracts.RepositoryEntities

Represents a runtime type with attributes.

public abstract class RtTypeWithAttributes

Inheritance ObjectRtTypeWithAttributes

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

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

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

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