Hi all,
Can anyone help me like when I'm reading the local storage file using async call it's not going forward from that line, If I use sync call it's giving "method executing unexpected time error" in UWP app, Please help me on this.
Sample code :
Task.Run(
async () =>
{
Model m = new Model();
Windows.Storage.StorageFile sf = await storageFolder.GetFileAsync(fileName);
var res = Windows.Storage.FileIO.ReadTextAsync(sf).GetResults();
var Data = JsonConvert.DeserializeObject(res);
}).Wait();
Thanks in advance


Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 2:32 AM EDT
Rama KrishnaRank #3,366 · 427 reputationPosted Oct 3, 2018, 2:39 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 2:45 AM EDT
Rama KrishnaRank #3,366 · 427 reputationPosted Oct 3, 2018, 3:14 AM EDT
What I understood is like method return type, it is model class and once the file read from class I will return the data to actual page and then i will render that data
Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 3:21 AM EDT
Rama KrishnaRank #3,366 · 427 reputationPosted Oct 3, 2018, 3:49 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 3:53 AM EDT
Rama KrishnaRank #3,366 · 427 reputationPosted Oct 3, 2018, 3:54 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 4:05 AM EDT
>(response.Content);
Rama KrishnaRank #3,366 · 427 reputationPosted Oct 3, 2018, 4:10 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Oct 3, 2018, 4:17 AM EDT