AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 4.5
 
A collection of attribute key-value pairs that defines an item in DynamoDB.

Inheritance Hierarchy

System.Object
  Amazon.DynamoDBv2.DocumentModel.DynamoDBEntry
    Amazon.DynamoDBv2.DocumentModel.Document

Namespace: Amazon.DynamoDBv2.DocumentModel
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class Document : DynamoDBEntry
         ICloneable, ICollection<KeyValuePair<String, DynamoDBEntry>>, IDictionary<String, DynamoDBEntry>, IEnumerable, IEnumerable<KeyValuePair<String, DynamoDBEntry>>

The Document type exposes the following members

Constructors

NameDescription
Public Method Document() Constructs an empty Document.
Public Method Document(Dictionary<String, DynamoDBEntry>)

Properties

NameTypeDescription
Public Property Count System.Int32
Public Property IsReadOnly System.Boolean
Public Property Item Amazon.DynamoDBv2.DocumentModel.DynamoDBEntry
Public Property Keys System.Collections.Generic.ICollection<System.String>
Public Property Values System.Collections.Generic.ICollection<Amazon.DynamoDBv2.DocumentModel.DynamoDBEntry>

Methods

NameDescription
Public Method Add(string, DynamoDBEntry)
Public Method Add(KeyValuePair<String, DynamoDBEntry>)
Public Method AsArrayOfDynamoDBEntry() Explicitly convert DynamoDBEntry to DynamoDBEntry[]
Public Method AsArrayOfPrimitive() Explicitly convert DynamoDBEntry to Primitive[]
Public Method AsArrayOfString() Explicitly convert DynamoDBEntry to String[]
Public Method AsBoolean() Explicitly convert DynamoDBEntry to Boolean
Public Method AsByte() Explicitly convert DynamoDBEntry to Byte
Public Method AsByteArray() Explicitly convert DynamoDBEntry to byte[]
Public Method AsChar() Explicitly convert DynamoDBEntry to Char
Public Method AsDateTime() Explicitly convert DynamoDBEntry to DateTime
Public Method AsDecimal() Explicitly convert DynamoDBEntry to Decimal
Public Method AsDocument() Convert DynamoDBEntry to Document
Public Method AsDouble() Explicitly convert DynamoDBEntry to Double
Public Method AsDynamoDBBool() Convert DynamoDBEntry to DynamoDBBool
Public Method AsDynamoDBList() Convert DynamoDBEntry to DynamoDBList
Public Method AsDynamoDBNull() Convert DynamoDBEntry to DynamoDBNull
Public Method AsGuid() Explicitly convert DynamoDBEntry to Guid
Public Method AsHashSetOfByteArray() Explicitly convert DynamoDBEntry to HashSet<byte[]>
Public Method AsHashSetOfDynamoDBEntry() Explicitly convert DynamoDBEntry to HashSet<DynamoDBEntry>
Public Method AsHashSetOfMemoryStream() Explicitly convert DynamoDBEntry to HashSet<MemoryStream>
Public Method AsHashSetOfPrimitive() Explicitly convert DynamoDBEntry to HashSet<Primitive>
Public Method AsHashSetOfString() Explicitly convert DynamoDBEntry to HashSet<String>
Public Method AsInt() Explicitly convert DynamoDBEntry to Int32
Public Method AsListOfByteArray() Explicitly convert DynamoDBEntry to List<byte[]>
Public Method AsListOfDocument() Explicitly convert DynamoDBEntry to List<Document>
Public Method AsListOfDynamoDBEntry() Explicitly convert DynamoDBEntry to List<DynamoDBEntry>
Public Method AsListOfMemoryStream() Explicitly convert DynamoDBEntry to List<MemoryStream>
Public Method AsListOfPrimitive() Explicitly convert DynamoDBEntry to List<Primitive>
Public Method AsListOfString() Explicitly convert DynamoDBEntry to List<String>
Public Method AsLong() Explicitly convert DynamoDBEntry to Int64
Public Method AsMemoryStream() Explicitly convert DynamoDBEntry to MemoryStream
Public Method AsPrimitive() Convert DynamoDBEntry to Primitive
Public Method AsPrimitiveList() Convert DynamoDBEntry to PrimitiveList
Public Method AsSByte() Explicitly convert DynamoDBEntry to SByte
Public Method AsShort() Explicitly convert DynamoDBEntry to Int16
Public Method AsSingle() Explicitly convert DynamoDBEntry to Single
Public Method AsString() Explicitly convert DynamoDBEntry to String
Public Method AsUInt() Explicitly convert DynamoDBEntry to UInt32
Public Method AsULong() Explicitly convert DynamoDBEntry to UInt64
Public Method AsUShort() Explicitly convert DynamoDBEntry to UInt16
Public Method Clear()
Public Method Clone()
Public Method Contains(string) Determines if a specific attribute is set on the Document.
Public Method Contains(KeyValuePair<String, DynamoDBEntry>)
Public Method ContainsKey(string)
Public Method CopyTo(KeyValuePair`2[], int)
Public Method DecodeBase64Attributes(String[])

Decodes root-level Base64-encoded strings to their binary representations. Use this method if the Document was constructed from JSON that contains base64-encoded binary values, which result from calling ToJson on a Document with binary data.

Individual strings become binary data. List and sets of Base64-encoded strings become lists and sets of binary data.

Public Method ForceConversion(DynamoDBEntryConversion) Returns a new instance of Document where all unconverted .NET types are converted to DynamoDBEntry types using a specific conversion.
Public Method Static Method FromAttributeMap(Dictionary<String, AttributeValue>) Creates a Document from an attribute map.
Public Method Static Method FromJson(string) Creates a document from a JSON string. The conversion is as follows: Objects are converted to DynamoDB M types. Arrays are converted to DynamoDB L types. Boolean types are converted to DynamoDB BOOL types. Null values are converted to DynamoDB NULL types. Numerics are converted to DynamoDB N types. Strings are converted to DynamoDB S types.
Public Method GetAttributeNames() Returns the names of all the attributes.
Public Method GetEnumerator()
Public Method IsAttributeChanged(string) Returns true if the attribute has been changed.
Public Method IsDirty() Returns true if the document contains attributes that have not been saved.
Public Method Remove(string)
Public Method Remove(KeyValuePair<String, DynamoDBEntry>)
Public Method ToAttributeMap() Creates a map of attribute names mapped to AttributeValue objects. Converts .NET types using the conversion specified by AWSConfigs.DynamoDBConfig.ConversionSchema
Public Method ToAttributeMap(DynamoDBEntryConversion) Creates a map of attribute names mapped to AttributeValue objects.
Public Method ToAttributeUpdateMap(bool) Creates a map of attribute names mapped to AttributeValueUpdate objects.
Public Method ToAttributeUpdateMap(DynamoDBEntryConversion, bool) Creates a map of attribute names mapped to AttributeValueUpdate objects.
Public Method ToExpectedAttributeMap() Creates a map of attribute names mapped to ExpectedAttributeValue objects.
Public Method ToExpectedAttributeMap(DynamoDBEntryConversion) Creates a map of attribute names mapped to ExpectedAttributeValue objects.
Public Method ToJson()

Converts the current Document into a matching JSON string.

DynamoDB types are a superset of JSON types, thus the following DynamoDB cannot be properly represented as JSON data: PrimitiveList (SS, NS, BS types) - these sets will be converted to JSON arrays Binary Primitive (B type) - binary data will be converted to Base64 strings

If the resultant JSON is passed to Document.FromJson, the binary values will be treated as Base64 strings. Invoke Document.DecodeBase64Attributes to decode these strings into binary data.

Public Method ToJsonPretty()

Converts the current Document into a matching pretty JSON string.

DynamoDB types are a superset of JSON types, thus the following DynamoDB cannot be properly represented as JSON data: PrimitiveList (SS, NS, BS types) - these sets will be converted to JSON arrays Binary Primitive (B type) - binary data will be converted to Base64 strings

If the resultant JSON is passed to Document.FromJson, the binary values will be treated as Base64 strings. Invoke Document.DecodeBase64Attributes to decode these strings into binary data.

Public Method TryGetValue(string, out DynamoDBEntry) Gets the value associated with the specified attribute value.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8