Interface IPrimitive
This interface is implemented by all source generated Primitively types. It provides a set of properties to encapsulate a value of a specific .NET primitive type and its metadata.
Namespace: Primitively
Assembly: Primitively.Abstractions.dll
Syntax
public interface IPrimitive
Properties
DataType
Gets the DataType enum representation of the type that the instance encapsulates.
Declaration
DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType | The DataType enum representation of the type that the instance encapsulates. |
HasValue
Gets a flag indicating whether the instance has a valid value.
Declaration
bool HasValue { get; }
Property Value
Type | Description |
---|---|
bool |
|
Remarks
Attempts to instantiate a Primitively type with an invalid value will result in a default instance.
Value
Gets the value encapsulated by the instance.
Declaration
object Value { get; }
Property Value
Type | Description |
---|---|
object | The value encapsulated by the instance. |
Remarks
Attempts to instantiate a Primitively type with an invalid value will result in a default instance.
ValueType
Gets the .NET primitive type of the value that the instance encapsulates.
Declaration
Type ValueType { get; }
Property Value
Type | Description |
---|---|
Type | The .NET primitive type of the value that the instance encapsulates. |