/// <param name='operations'> /// Reference to the DXNewsApp.IDXNewsAppClient. /// </param> public static NewsItem LatestNewsItem(this IDXNewsAppClient operations) { return(Task.Factory.StartNew((object s) => { return ((IDXNewsAppClient)s).LatestNewsItemAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public MainViewModel(IDXNewsAppClient client) { this.client = client; NewsItems = new ObservableCollection <NewsItem>(client.GetNews()); }
/// <param name='operations'> /// Reference to the DXNewsApp.IDXNewsAppClient. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <NewsItem> LatestNewsItemAsync(this IDXNewsAppClient operations, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <DXNewsApp.Models.NewsItem> result = await operations.LatestNewsItemWithOperationResponseAsync(cancellationToken).ConfigureAwait(false); return(result.Body); }