Amazon AWS SDK Guide de l'utilisateur Page 51 : NuGet Package Manager Console
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
•
Using Expressions with DynamoDB (p. 52)
•
JSON Support in Amazon DynamoDB (p. 63)
•
Managing ASP.NET Session State with Amazon DynamoDB (p. 65)
Programming Models
The SDK for .NET provides three different programming models for communicating with DynamoDB.
These programming models include the
low-level
model, the
document
model, and the
object persistence
model. The following information describes these models, how to use them, and when you might want
to use them.
Topics
•
Low-Level (p. 47)
•
Document (p. 50)
•
Object Persistence (p. 51)
Low-Level
The low-level programming model wraps direct calls to the DynamoDB service.You access this model
through the
Amazon.DynamoDBv2
namespace.
Of the three models, the low-level model requires you to write the most code. For example, you must
convert .NET data types to their equivalents in DynamoDB. However, this model gives you access to the
most features.
The following example shows how to use the low-level model to create a table in DynamoDB:
// using Amazon.DynamoDBv2;
// using Amazon.DynamoDBv2.Model;
var client = new AmazonDynamoDBClient();
var request = new CreateTableRequest
{
TableName = "AnimalsInventory",
AttributeDefinitions = new List<AttributeDefinition>
{
new AttributeDefinition
{
AttributeName = "Id",
// "S" = string, "N" = number, and so on.
AttributeType = "N"
},
new AttributeDefinition
{
AttributeName = "Type",
AttributeType = "S"
}
},
KeySchema = new List<KeySchemaElement>
{
new KeySchemaElement
{
AttributeName = "Id",
Version v2.0.0
47
AWS SDK for .NET Developer Guide
Programming Models
Fichier PDF · ·
Questions sur Amazon AWS SDK
Pas encore de questions sur ce manuel. Posez la première.
Produits connexes et manuels pour Logiciel Amazon AWS SDK
- Logiciel Amazon Redshift Manuel d'utilisateur
(24 pages) - Logiciel Amazon Redshift Manuel d'utilisateur
(11 pages) - Logiciel Amazon AWS SDK Guide de l'utilisateur
(73 pages)