1
- // Copyright (c) Microsoft Corporation. All rights reserved.
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the MIT License.
3
3
4
4
using Microsoft . AspNetCore . Http ;
@@ -51,7 +51,6 @@ public async Task<Todo> AddAsync(Todo todo)
51
51
52
52
var jsonRequest = JsonConvert . SerializeObject ( todo ) ;
53
53
var jsoncontent = new StringContent ( jsonRequest , Encoding . UTF8 , "application/json" ) ;
54
-
55
54
var response = await this . _httpClient . PostAsync ( $ "{ _TodoListBaseAddress } /api/todolist", jsoncontent ) ;
56
55
57
56
if ( response . StatusCode == HttpStatusCode . OK )
@@ -69,7 +68,7 @@ public async Task DeleteAsync(int id)
69
68
{
70
69
await PrepareAuthenticatedClient ( ) ;
71
70
72
- var response = await this . _httpClient . DeleteAsync ( $ "{ _TodoListBaseAddress } /api/todolist/{ id } ") ;
71
+ var response = await _httpClient . DeleteAsync ( $ "{ _TodoListBaseAddress } /api/todolist/{ id } ") ;
73
72
74
73
if ( response . StatusCode == HttpStatusCode . OK )
75
74
{
@@ -85,7 +84,6 @@ public async Task<Todo> EditAsync(Todo todo)
85
84
86
85
var jsonRequest = JsonConvert . SerializeObject ( todo ) ;
87
86
var jsoncontent = new StringContent ( jsonRequest , Encoding . UTF8 , "application/json-patch+json" ) ;
88
-
89
87
var response = await _httpClient . PatchAsync ( $ "{ _TodoListBaseAddress } /api/todolist/{ todo . Id } ", jsoncontent ) ;
90
88
91
89
if ( response . StatusCode == HttpStatusCode . OK )
@@ -102,7 +100,6 @@ public async Task<Todo> EditAsync(Todo todo)
102
100
public async Task < IEnumerable < Todo > > GetAsync ( )
103
101
{
104
102
await PrepareAuthenticatedClient ( ) ;
105
-
106
103
var response = await _httpClient . GetAsync ( $ "{ _TodoListBaseAddress } /api/todolist") ;
107
104
if ( response . StatusCode == HttpStatusCode . OK )
108
105
{
@@ -126,7 +123,6 @@ private async Task PrepareAuthenticatedClient()
126
123
public async Task < Todo > GetAsync ( int id )
127
124
{
128
125
await PrepareAuthenticatedClient ( ) ;
129
-
130
126
var response = await _httpClient . GetAsync ( $ "{ _TodoListBaseAddress } /api/todolist/{ id } ") ;
131
127
if ( response . StatusCode == HttpStatusCode . OK )
132
128
{
0 commit comments