Skip to content
This repository was archived by the owner on Oct 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
</Target>
-->
<ItemGroup>
<Reference Include="AWSSDK.Core">
<HintPath>..\packages\AWSSDK.Core.3.0.0.2-preview\lib\net35\AWSSDK.Core.dll</HintPath>
<Reference Include="AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.Core.3.3.25\lib\net35\AWSSDK.Core.dll</HintPath>
</Reference>
<Reference Include="AWSSDK.DynamoDBv2">
<HintPath>..\packages\AWSSDK.DynamoDBv2.3.0.0.3-preview\lib\net35\AWSSDK.DynamoDBv2.dll</HintPath>
<Reference Include="AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604, processorArchitecture=MSIL">
<HintPath>..\packages\AWSSDK.DynamoDBv2.3.3.13\lib\net35\AWSSDK.DynamoDBv2.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down Expand Up @@ -117,7 +117,12 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\AWSSDK.DynamoDBv2.3.3.13\analyzers\dotnet\cs\AWSSDK.DynamoDBv2.CodeAnalysis.dll" />
</ItemGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void RunDocumentModelSample()
chainStore2["State"] = "NY";
table.PutItem(chainStore2);

Console.WriteLine("Creating and saving first item");
Console.WriteLine("Creating and saving second item");
Document chainStore13 = new Document();
chainStore13["Name"] = "Big Sales Inc";
chainStore13["Id"] = 13;
Expand All @@ -53,7 +53,7 @@ public static void RunDocumentModelSample()
chainStore13["State"] = "IL";
table.PutItem(chainStore13);

Console.WriteLine("Creating and saving second item");
Console.WriteLine("Creating and saving third item");
Document tinyDiner = new Document();
tinyDiner["Name"] = "Tiny Map-themed Diner";
tinyDiner["Id"] = 0;
Expand All @@ -64,7 +64,7 @@ public static void RunDocumentModelSample()
table.PutItem(tinyDiner);


Console.WriteLine("Creating and saving third item");
Console.WriteLine("Creating and saving fourth item");
Document internetStore = new Document();
internetStore["Name"] = "Best Online Store Ever";
internetStore["Id"] = 0;
Expand All @@ -75,8 +75,16 @@ public static void RunDocumentModelSample()
internetStore["Phone"] = "425-555-1234";
table.PutItem(internetStore);

Search scan;
ScanFilter scanFilter;
Console.WriteLine();
Console.WriteLine("Scanning for items (no filter) to get count");
scanFilter = new ScanFilter();
scan = table.Scan(scanFilter);
Console.WriteLine("Number of items returned (should be 4): " + scan.Count);
Console.WriteLine();

Console.WriteLine("Loading item");
Console.WriteLine("Loading item");
Document doc1 = table.GetItem("Big Sales Inc", 2);
Console.WriteLine("Attribute counts match (should be true): " +
(chainStore2.GetAttributeNames().Count == doc1.GetAttributeNames().Count));
Expand All @@ -103,7 +111,6 @@ public static void RunDocumentModelSample()
Console.WriteLine("Returned document == null (should be true): " + (doc3 == null));



Search query;
Console.WriteLine();
Console.WriteLine("Querying for items (Equals)");
Expand All @@ -126,8 +133,9 @@ public static void RunDocumentModelSample()
while (!query.IsDone)
{
Console.WriteLine("Retrieving next set (page) of items");
List<Document> querySet = query.GetNextSet();
Console.WriteLine("Number of items returned in set (should be 1, unless last set, which will be 0): " + querySet.Count);
List<Document> querySet = query.GetNextSet();
Console.WriteLine("More items (Should be true until last set): " + !query.IsDone);
Console.WriteLine("Number of items returned in set (should be 1 (will be 0 for final set - no more to get): " + querySet.Count);

foreach (Document doc in querySet)
{
Expand All @@ -142,10 +150,6 @@ public static void RunDocumentModelSample()
Console.WriteLine("Total items found (should be 2): " + totalItems);



Search scan;
ScanFilter scanFilter;

Console.WriteLine();
Console.WriteLine("Scanning for items (GreaterThan)");
scanFilter = new ScanFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void Main(string[] args)
{
Console.WriteLine();
Console.WriteLine("Setting up DynamoDB client");
client = new AmazonDynamoDBClient(RegionEndpoint.USWest2);
client = new AmazonDynamoDBClient(RegionEndpoint.USWest2);

Console.WriteLine();
Console.WriteLine("Creating sample tables");
Expand All @@ -44,15 +44,15 @@ public static void Main(string[] args)
RunDataModelSample();

Console.WriteLine();
Console.WriteLine("Running DataModel sample");
Console.WriteLine("Running DocumentModel sample");
RunDocumentModelSample();

Console.WriteLine();
Console.WriteLine("Removing sample tables");
DeleteSampleTables();

Console.WriteLine();
Console.WriteLine("Press Enter to continue...");
Console.WriteLine("Press the Enter key to end the program...");
Console.Read();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AWSSDK.Core" version="3.0.0.2-preview" targetFramework="net35" />
<package id="AWSSDK.DynamoDBv2" version="3.0.0.3-preview" targetFramework="net35" />
<package id="AWSSDK.Core" version="3.3.25" targetFramework="net35" />
<package id="AWSSDK.DynamoDBv2" version="3.3.13" targetFramework="net35" />
</packages>