-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.NET (v3): Add Hello DynamoDB example (#5037)
- Loading branch information
Showing
15 changed files
with
174 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
dotnetv3/dynamodb/scenarios/DynamoDB_Basics/DynamoDB_Actions/DynamoDB_Actions.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.105.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
dotnetv3/dynamodb/scenarios/DynamoDB_Basics/DynamoDB_Actions/HelloDynamoDB.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// snippet-start:[DynamoDB.dotnetv3.HelloDynamoDB] | ||
|
||
using Amazon.DynamoDBv2; | ||
using Amazon.DynamoDBv2.Model; | ||
|
||
namespace DynamoDB_Actions; | ||
|
||
public static class HelloDynamoDB | ||
{ | ||
static async Task Main(string[] args) | ||
{ | ||
var dynamoDbClient = new AmazonDynamoDBClient(); | ||
|
||
Console.WriteLine($"Hello Amazon Dynamo DB! Following are some of your tables:"); | ||
Console.WriteLine(); | ||
|
||
// You can use await and any of the async methods to get a response. | ||
// Let's get the first five tables. | ||
var response = await dynamoDbClient.ListTablesAsync( | ||
new ListTablesRequest() | ||
{ | ||
Limit = 5 | ||
}); | ||
|
||
foreach (var table in response.TableNames) | ||
{ | ||
Console.WriteLine($"\tTable: {table}"); | ||
Console.WriteLine(); | ||
} | ||
} | ||
} | ||
|
||
// snippet-end:[DynamoDB.dotnetv3.HelloDynamoDB] |
6 changes: 3 additions & 3 deletions
6
..._Basics/DynamoDB_Basics_Scenario/Movie.cs → ...DynamoDB_Basics/DynamoDB_Actions/Movie.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...ics/DynamoDB_Basics_Scenario/MovieInfo.cs → ...moDB_Basics/DynamoDB_Actions/MovieInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
dotnetv3/dynamodb/scenarios/DynamoDB_Basics/DynamoDB_Basics_Scenario.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32328.378 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoDB_Basics_Scenario", "DynamoDB_Basics_Scenario\DynamoDB_Basics_Scenario.csproj", "{C5E431E0-4ED7-4C38-A655-BFDEFD179C74}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoDB_Basics_ScenarioTests", "DynamoDB_Basics_ScenarioTests\DynamoDB_Basics_ScenarioTests.csproj", "{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{6626DB2A-9F51-4984-9E97-74011A91A0F7}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenarios", "Scenarios", "{C1ED3556-F8C6-4E93-B650-B013AB277F75}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F2D31BC8-AB1A-463F-AB53-FDB670084778}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamoDB_Actions", "DynamoDB_Actions\DynamoDB_Actions.csproj", "{B4C172AE-AE05-499A-B16A-72C01A7F24C7}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C5E431E0-4ED7-4C38-A655-BFDEFD179C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C5E431E0-4ED7-4C38-A655-BFDEFD179C74}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C5E431E0-4ED7-4C38-A655-BFDEFD179C74}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C5E431E0-4ED7-4C38-A655-BFDEFD179C74}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B4C172AE-AE05-499A-B16A-72C01A7F24C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B4C172AE-AE05-499A-B16A-72C01A7F24C7}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B4C172AE-AE05-499A-B16A-72C01A7F24C7}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B4C172AE-AE05-499A-B16A-72C01A7F24C7}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{C5E431E0-4ED7-4C38-A655-BFDEFD179C74} = {C1ED3556-F8C6-4E93-B650-B013AB277F75} | ||
{0B77DDFD-A2DF-41BD-8D61-3B93167EA34F} = {F2D31BC8-AB1A-463F-AB53-FDB670084778} | ||
{B4C172AE-AE05-499A-B16A-72C01A7F24C7} = {6626DB2A-9F51-4984-9E97-74011A91A0F7} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {39F603C9-C788-4E8C-8D3E-937478525CF9} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
.../dynamodb/scenarios/DynamoDB_Basics/DynamoDB_Basics_Scenario/DynamoDB_Basics_Scenario.sln
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../dynamodb/scenarios/DynamoDB_Basics/DynamoDB_Basics_ScenarioTests/DynamoDbMethodsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.