Class Primitive
- Namespace
- Amazon.DynamoDBv2.DocumentModel
- Assembly
- AWSSDK.DynamoDBv2.dll
A DynamoDBEntry that represents a scalar DynamoDB type
public class Primitive : DynamoDBEntry, ICloneable, IEquatable<Primitive>- Inheritance
- 
      
      
      Primitive
- Implements
- Inherited Members
Constructors
Primitive()
Constructs an empty Primitive
public Primitive()Primitive(byte[])
Constructs a Binary Primitive with the specified byte[] value.
public Primitive(byte[] value)Parameters
- valuebyte[]
- Value of the Primitive 
Primitive(MemoryStream)
Constructs a Binary Primitive with the specified MemoryStream value. Note: Primitive's Value is set to the stream's ToArray() response.
public Primitive(MemoryStream value)Parameters
- valueMemoryStream
- Value of the Primitive 
Primitive(string)
Constructs a Primitive with the specified value. Value is stored as a string, not numeric.
public Primitive(string value)Parameters
- valuestring
- Value of the Primitive 
Primitive(string, bool)
Constructs a Primitive with the specified value and specifies whether it should be stored as a number or not.
public Primitive(string value, bool saveAsNumeric)Parameters
- valuestring
- Value of the Primitive 
- saveAsNumericbool
- Flag, set to true if value should be treated as a number instead of a string 
Properties
Type
Type of this primitive object
public DynamoDBEntryType Type { get; set; }Property Value
Value
Value of the Primitive. If Type is String or Numeric, this property is a string. If Type is Binary, this property is a byte array.
public object Value { get; set; }Property Value
Methods
AsBoolean()
Explicitly convert Primitive to Boolean
public override bool AsBoolean()Returns
- bool
- Boolean value of this object 
AsByte()
Explicitly convert Primitive to Byte
public override byte AsByte()Returns
- byte
- Byte value of this object 
AsByteArray()
Explicitly convert Primitive to byte[]
public override byte[] AsByteArray()Returns
- byte[]
- byte[] value of this object 
AsChar()
Explicitly convert Primitive to Char
public override char AsChar()Returns
- char
- Char value of this object 
AsDateTime()
Explicitly convert Primitive to DateTime
public override DateTime AsDateTime()Returns
- DateTime
- DateTime value of this object 
AsDecimal()
Explicitly convert Primitive to Decimal
public override decimal AsDecimal()Returns
- decimal
- Decimal value of this object 
AsDouble()
Explicitly convert Primitive to Double
public override double AsDouble()Returns
- double
- Double value of this object 
AsGuid()
Explicitly convert Primitive to Guid
public override Guid AsGuid()Returns
- Guid
- Guid value of this object 
AsInt()
Explicitly convert Primitive to Int32
public override int AsInt()Returns
- int
- Int32 value of this object 
AsLong()
Explicitly convert Primitive to Int64
public override long AsLong()Returns
- long
- Int64 value of this object 
AsMemoryStream()
Explicitly convert Primitive to MemoryStream
public override MemoryStream AsMemoryStream()Returns
- MemoryStream
- MemoryStream value of this object 
AsSByte()
Explicitly convert Primitive to SByte
[CLSCompliant(false)]
public override sbyte AsSByte()Returns
- sbyte
- SByte value of this object 
AsShort()
Explicitly convert Primitive to Int16
public override short AsShort()Returns
- short
- Int16 value of this object 
AsSingle()
Explicitly convert Primitive to Single
public override float AsSingle()Returns
- float
- Single value of this object 
AsString()
Explicitly convert Primitive to String
public override string AsString()Returns
- string
- String value of this object 
AsUInt()
Explicitly convert Primitive to UInt32
[CLSCompliant(false)]
public override uint AsUInt()Returns
- uint
- UInt32 value of this object 
AsULong()
Explicitly convert Primitive to UInt64
[CLSCompliant(false)]
public override ulong AsULong()Returns
- ulong
- UInt64 value of this object 
AsUShort()
Explicitly convert Primitive to UInt16
[CLSCompliant(false)]
public override ushort AsUShort()Returns
- ushort
- UInt16 value of this object 
Clone()
Implement the Clone method.
public override object Clone()Returns
Equals(Primitive)
Implement the Equals method from the IEquatable interface.
public bool Equals(Primitive other)Parameters
- otherPrimitive
Returns
Equals(object)
Implement the Equals method.
public override bool Equals(object obj)Parameters
- objobject
Returns
GetHashCode()
Implement the GetHashCode method.
public override int GetHashCode()Returns
ToString()
Implement the ToString method.
public override string ToString()Returns
Operators
explicit operator bool(Primitive)
Explicitly convert Primitive to Boolean
public static explicit operator bool(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- bool
- Boolean value of Primitive 
explicit operator byte(Primitive)
Explicitly convert Primitive to Byte
public static explicit operator byte(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- byte
- Byte value of Primitive 
explicit operator byte[](Primitive)
Explicitly convert Primitive to byte[]
public static explicit operator byte[](Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- byte[]
- byte[] value of Primitive 
explicit operator char(Primitive)
Explicitly convert Primitive to Char
public static explicit operator char(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- char
- Char value of Primitive 
explicit operator DateTime(Primitive)
Explicitly convert Primitive to DateTime
public static explicit operator DateTime(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- DateTime
- DateTime value of Primitive 
explicit operator decimal(Primitive)
Explicitly convert Primitive to Decimal
public static explicit operator decimal(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- decimal
- Decimal value of Primitive 
explicit operator double(Primitive)
Explicitly convert Primitive to Double
public static explicit operator double(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- double
- Double value of Primitive 
explicit operator Guid(Primitive)
Explicitly convert Primitive to Guid
public static explicit operator Guid(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- Guid
- Guid value of Primitive 
explicit operator MemoryStream(Primitive)
Explicitly convert Primitive to MemoryStream
public static explicit operator MemoryStream(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- MemoryStream
- MemoryStream value of Primitive 
explicit operator short(Primitive)
Explicitly convert Primitive to Int16
public static explicit operator short(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- short
- Int16 value of Primitive 
explicit operator int(Primitive)
Explicitly convert Primitive to Int32
public static explicit operator int(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- int
- Int32 value of Primitive 
explicit operator long(Primitive)
Explicitly convert Primitive to Int64
public static explicit operator long(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- long
- Int64 value of Primitive 
explicit operator sbyte(Primitive)
Explicitly convert Primitive to SByte
[CLSCompliant(false)]
public static explicit operator sbyte(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- sbyte
- SByte value of Primitive 
explicit operator float(Primitive)
Explicitly convert Primitive to Single
public static explicit operator float(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- float
- Single value of Primitive 
explicit operator ushort(Primitive)
Explicitly convert Primitive to UInt16
[CLSCompliant(false)]
public static explicit operator ushort(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- ushort
- UInt16 value of Primitive 
explicit operator uint(Primitive)
Explicitly convert Primitive to UInt32
[CLSCompliant(false)]
public static explicit operator uint(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- uint
- UInt32 value of Primitive 
explicit operator ulong(Primitive)
Explicitly convert Primitive to UInt64
[CLSCompliant(false)]
public static explicit operator ulong(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- ulong
- UInt64 value of Primitive 
implicit operator string(Primitive)
Explicitly convert Primitive to String
public static implicit operator string(Primitive p)Parameters
- pPrimitive
- Primitive to convert 
Returns
- string
- String value of Primitive 
implicit operator Primitive(bool)
Implicitly convert Boolean to Primitive
public static implicit operator Primitive(bool data)Parameters
- databool
- Boolean data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(byte)
Implicitly convert Byte to Primitive
public static implicit operator Primitive(byte data)Parameters
- databyte
- Byte data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(byte[])
Implicitly convert byte[] to Primitive
public static implicit operator Primitive(byte[] data)Parameters
- databyte[]
- byte[] data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(char)
Implicitly convert Char to Primitive
public static implicit operator Primitive(char data)Parameters
- datachar
- Char data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(DateTime)
Implicitly convert DateTime to Primitive
public static implicit operator Primitive(DateTime data)Parameters
- dataDateTime
- DateTime data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(decimal)
Implicitly convert Decimal to Primitive
public static implicit operator Primitive(decimal data)Parameters
- datadecimal
- Decimal data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(double)
Implicitly convert Double to Primitive
public static implicit operator Primitive(double data)Parameters
- datadouble
- Double data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(Guid)
Implicitly convert Guid to Primitive
public static implicit operator Primitive(Guid data)Parameters
- dataGuid
- Guid data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(MemoryStream)
Implicitly convert MemoryStream to Primitive
public static implicit operator Primitive(MemoryStream data)Parameters
- dataMemoryStream
- MemoryStream data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(short)
Implicitly convert Int16 to Primitive
public static implicit operator Primitive(short data)Parameters
- datashort
- Int16 data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(int)
Implicitly convert Int32 to Primitive
public static implicit operator Primitive(int data)Parameters
- dataint
- Int32 data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(long)
Implicitly convert Int64 to Primitive
public static implicit operator Primitive(long data)Parameters
- datalong
- Int64 data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(sbyte)
Implicitly convert SByte to Primitive
[CLSCompliant(false)]
public static implicit operator Primitive(sbyte data)Parameters
- datasbyte
- SByte data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(float)
Implicitly convert Single to Primitive
public static implicit operator Primitive(float data)Parameters
- datafloat
- Single data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(string)
Implicitly convert String to Primitive
public static implicit operator Primitive(string data)Parameters
- datastring
- String data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(ushort)
Implicitly convert UInt16 to Primitive
[CLSCompliant(false)]
public static implicit operator Primitive(ushort data)Parameters
- dataushort
- UInt16 data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(uint)
Implicitly convert UInt32 to Primitive
[CLSCompliant(false)]
public static implicit operator Primitive(uint data)Parameters
- datauint
- UInt32 data to convert 
Returns
- Primitive
- Primitive representing the data 
implicit operator Primitive(ulong)
Implicitly convert UInt64 to Primitive
[CLSCompliant(false)]
public static implicit operator Primitive(ulong data)Parameters
- dataulong
- UInt64 data to convert 
Returns
- Primitive
- Primitive representing the data