fix sync call for uwp

This commit is contained in:
Jerome Dreyer 2016-04-11 08:24:18 +02:00
parent f5dd7ae031
commit a8bbb37866

View File

@ -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}}