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
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
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
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
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
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
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
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
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
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
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
Exceptions
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