From c57aed84a77cb216303931398c05347013da9b90 Mon Sep 17 00:00:00 2001 From: Noufal Aboobacker Date: Wed, 21 Mar 2018 14:43:44 +0400 Subject: [PATCH] Update GetCustomerOrders Method The request ```csharp string request = "api/Order?customerId=" + customerId ``` always calls the Get method resulting to fetch all the records. --- NetCoreSample.ConsoleClient/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NetCoreSample.ConsoleClient/Program.cs b/NetCoreSample.ConsoleClient/Program.cs index 32c9840..e79c0b6 100644 --- a/NetCoreSample.ConsoleClient/Program.cs +++ b/NetCoreSample.ConsoleClient/Program.cs @@ -140,7 +140,8 @@ private static IEnumerable GetCustomers(HttpClient client, MediaTypeFo private static IEnumerable GetCustomerOrders (HttpClient client, string customerId, MediaTypeFormatter formatter) { - string request = "api/Order?customerId=" + customerId; + //string request = "api/Order?customerId=" + customerId; + string request = $"api/Order/{customerId}"; var response = client.GetAsync(request).Result; response.EnsureSuccessStatusCode(); var result = response.Content.ReadAsAsync>(new[] { formatter }).Result;