minor fixes in the partial code of update & delete definition (#3362)

* Update sample9.cs

updated method definition Task<Product> as it should return product Task<Product>

* Update sample10.cs

Updating definition to return status code (Task<HttpStatusCode>)
pull/3368/head
fareszekri 2017-05-15 23:17:15 +02:00 committed by Rick Anderson
parent 184fe30215
commit 39939f6f27
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
static async Task DeleteProductAsync(string id)
static async Task<HttpStatusCode> DeleteProductAsync(string id)
{
HttpResponseMessage response = await client.DeleteAsync($"api/products/{id}");
return response.StatusCode;
}
}

View File

@ -1,4 +1,4 @@
static async Task UpdateProductAsync(Product product)
static async Task<Product> UpdateProductAsync(Product product)
{
HttpResponseMessage response = await client.PutAsJsonAsync($"api/products/{product.Id}", product);
response.EnsureSuccessStatusCode();
@ -6,4 +6,4 @@ static async Task UpdateProductAsync(Product product)
// Deserialize the updated product from the response body.
product = await response.Content.ReadAsAsync<Product>();
return product;
}
}