From a8bbb378669cabf32760375dcfff55cd71fe3da5 Mon Sep 17 00:00:00 2001 From: Jerome Dreyer Date: Mon, 11 Apr 2016 08:24:18 +0200 Subject: [PATCH] fix sync call for uwp --- .../src/main/resources/csharp/ApiClient.mustache | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index ba1b5da1d3c..067d5c083a5 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -163,11 +163,9 @@ namespace {{packageName}}.Client var response = RestClient.Execute(request); {{/supportsUWP}} {{#supportsUWP}} - // TODO: This is obviously not a valid response, but it prevents compiling-errors - // 'RestClient.CallApiAsync(..)' is used instead, because 'RestClient.ExecuteAsync(...)' - // is available for Windows UWP, while 'RestClient.CallApi(...)' is not - var response = new object(); - {{/supportsUWP}} + // Using async method to perform sync call (uwp-only) + var response = RestClient.ExecuteTaskAsync(request).Result; + {{/supportsUWP}} return (Object) response; } {{#supportsAsync}}