Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit a28d98e

Browse files
committed
Type clarifications.
1 parent f6a8ba1 commit a28d98e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

WebServices/TodoREST/TodoREST/Data/RestService.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ public async Task<List<TodoItem>> RefreshDataAsync()
2828
{
2929
Items = new List<TodoItem>();
3030

31-
var uri = new Uri(string.Format(Constants.RestUrl, string.Empty));
31+
Uri uri = new Uri(string.Format(Constants.RestUrl, string.Empty));
3232
try
3333
{
34-
var response = await client.GetAsync(uri);
34+
HttpResponseMessage response = await client.GetAsync(uri);
3535
if (response.IsSuccessStatusCode)
3636
{
37-
var content = await response.Content.ReadAsStringAsync();
37+
string content = await response.Content.ReadAsStringAsync();
3838
Items = JsonConvert.DeserializeObject<List<TodoItem>>(content);
3939
}
4040
}
@@ -48,12 +48,12 @@ public async Task<List<TodoItem>> RefreshDataAsync()
4848

4949
public async Task SaveTodoItemAsync(TodoItem item, bool isNewItem = false)
5050
{
51-
var uri = new Uri(string.Format(Constants.RestUrl, string.Empty));
51+
Uri uri = new Uri(string.Format(Constants.RestUrl, string.Empty));
5252

5353
try
5454
{
55-
var json = JsonConvert.SerializeObject(item);
56-
var content = new StringContent(json, Encoding.UTF8, "application/json");
55+
string json = JsonConvert.SerializeObject(item);
56+
StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
5757

5858
HttpResponseMessage response = null;
5959
if (isNewItem)
@@ -79,11 +79,11 @@ public async Task SaveTodoItemAsync(TodoItem item, bool isNewItem = false)
7979

8080
public async Task DeleteTodoItemAsync(string id)
8181
{
82-
var uri = new Uri(string.Format(Constants.RestUrl, id));
82+
Uri uri = new Uri(string.Format(Constants.RestUrl, id));
8383

8484
try
8585
{
86-
var response = await client.DeleteAsync(uri);
86+
HttpResponseMessage response = await client.DeleteAsync(uri);
8787

8888
if (response.IsSuccessStatusCode)
8989
{

0 commit comments

Comments
 (0)