Skip to content

Commit f2d41ce

Browse files
author
Ryan CrawCour
committed
Merge pull request Azure#110 from HEDIDIN/master
Added code to display results of each operation in the Console
2 parents 93ffad9 + fc11af5 commit f2d41ce

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

samples/rest-from-.net/Program.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ static void Main(string[] args)
8282
client.DefaultRequestHeaders.Add("authorization", authHeader);
8383

8484
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
85+
86+
Console.WriteLine(response);
87+
Console.ReadKey();
8588

8689
//GET a database
8790
verb = "GET";
@@ -95,6 +98,10 @@ static void Main(string[] args)
9598
client.DefaultRequestHeaders.Add("authorization", authHeader);
9699

97100
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
101+
102+
Console.WriteLine(response);
103+
Console.ReadKey();
104+
98105

99106
//LIST all collections
100107
verb = "GET";
@@ -108,6 +115,9 @@ static void Main(string[] args)
108115
client.DefaultRequestHeaders.Add("authorization", authHeader);
109116

110117
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
118+
119+
Console.WriteLine(response);
120+
Console.ReadKey();
111121

112122
//GET a collections
113123
verb = "GET";
@@ -121,6 +131,9 @@ static void Main(string[] args)
121131
client.DefaultRequestHeaders.Add("authorization", authHeader);
122132

123133
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
134+
135+
Console.WriteLine(response);
136+
Console.ReadKey();
124137

125138
//LIST all documents in a collection
126139
verb = "GET";
@@ -134,6 +147,9 @@ static void Main(string[] args)
134147
client.DefaultRequestHeaders.Add("authorization", authHeader);
135148

136149
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
150+
151+
Console.WriteLine(response);
152+
Console.ReadKey();
137153

138154
//GET a document
139155
verb = "GET";
@@ -147,6 +163,9 @@ static void Main(string[] args)
147163
client.DefaultRequestHeaders.Add("authorization", authHeader);
148164

149165
response = client.GetStringAsync(new Uri(baseUri, resourceLink)).Result;
166+
167+
Console.WriteLine(response);
168+
Console.ReadKey();
150169

151170
//EXECUTE a query
152171
verb = "POST";
@@ -186,4 +205,4 @@ private static string GenerateMasterKeyAuthorizationSignature(string verb, strin
186205
signature));
187206
}
188207
}
189-
}
208+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
3+
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" />
44
<package id="System.Net.Http" version="2.0.20126.16343" targetFramework="net45" />
55
<package id="System.Net.Http.Formatting.Extension" version="5.2.3.0" targetFramework="net45" />
6-
</packages>
6+
</packages>

0 commit comments

Comments
 (0)