Use of Async and Await
From Legacy code: .... var client = new WebClient(); var content = client.DownloadString($"http://localhost:62323/api/stocks /{Ticker.Text}"); var data = JsonConvert.DeserializeObject <IEnumberable<StrockPrice>>(content); Stocks.ItemSource = data; ... converted using Async and Await: //same thing we are going to achieve using httpclient ... try { using(var client = new HttpClient()) { var result = await client. GetAsync($"http://localhost:2323/api/stocks /{Ticker.Text}") var content = await result.content.ReadAsStringAsync(); var data = JsonConvert.DeserializeObject <IEnumberable<StockPrice>>(content); Stocks.ItemSource = data } } catch(Exception ex) { } ...






MGL made money sell side
ReplyDelete1141
IGL also sell side
1378
HINDPetro also sell side
443
ESCORTS move both side. buy TG1 and Sell TG2
Amarajabat sell side 777