FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
DynamoDB.SourceGenerator/samples/KeyConversion/Program.cs at main · inputfalken/DynamoDB.SourceGenerator · GitHub
inputfalken
/
DynamoDB.SourceGenerator
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
4
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
DynamoDB.SourceGenerator
/
samples
/
KeyConversion
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (23 loc) · 1.25 KB
Breadcrumbs
DynamoDB.SourceGenerator
/
samples
/
KeyConversion
/
Program.cs
Copy path
File metadata and controls
31 lines (23 loc) · 1.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
// See https://aka.ms/new-console-template for more information
using
Amazon
.
DynamoDBv2
.
DataModel
;
using
DynamoDBGenerator
.
Attributes
;
// PrimaryKeyMarshaller is used to convert the keys obtained from the [DynamoDBHashKey] and [DynamoDBRangeKey] attributes.
var
keyMarshaller
=
EntityDTO
.
KeyMarshallerSample
.
PrimaryKeyMarshaller
;
// IndexKeyMarshaller requires an argument that is the index name so it can provide you with the correct conversion based on the indexes you may have.
// It works the same way for both LocalSecondaryIndex and GlobalSecondaryIndex attributes.
var
GSIKeyMarshaller
=
EntityDTO
.
KeyMarshallerSample
.
IndexKeyMarshaller
(
"GSI"
)
;
var
LSIKeyMarshaller
=
EntityDTO
.
KeyMarshallerSample
.
IndexKeyMarshaller
(
"LSI"
)
;
[
DynamoDBMarshaller
(
AccessName
=
"KeyMarshallerSample"
)
]
public
partial
class
EntityDTO
{
[
DynamoDBHashKey
(
"PK"
)
]
public
string
Id
{
get
;
set
;
}
[
DynamoDBRangeKey
(
"RK"
)
]
public
string
RangeKey
{
get
;
set
;
}
[
DynamoDBLocalSecondaryIndexRangeKey
(
"LSI"
)
]
public
string
SecondaryRangeKey
{
get
;
set
;
}
[
DynamoDBGlobalSecondaryIndexHashKey
(
"GSI"
)
]
public
string
GlobalSecondaryIndexId
{
get
;
set
;
}
[
DynamoDBGlobalSecondaryIndexRangeKey
(
"GSI"
)
]
public
string
GlobalSecondaryIndexRangeKey
{
get
;
set
;
}
}
Back
|
FazBrowse Home
|
New Git URL