0

When consuming my (pretty huge) OData payloads, the UI thread is frozen upon reading the data into proxy classes.

Is there a way to dispatch this workload to a different thread, so that data is quietly loaded without disturbing the UI?

anomistu
  • 61
  • 4
  • 3
    use async and await - http://www.codearsenal.net/2012/11/csharp-5-async-and-await-example.html#.WVUYxYjytaQ – Derek Jun 29 '17 at 15:12
  • Hi @Derek, I've tried it but it did not seem to help, reasons are found here https://stackoverflow.com/questions/27265818/does-the-use-of-async-await-create-a-new-thread I followed this tutorial to create the Task wrapper around the LoadCompleted/LoadAsync pattern: https://www.codeproject.com/Articles/455572/OData-with-async. – anomistu Jul 03 '17 at 14:12
  • Also, I noticed that forcing the call itself on a different thread leads to loss of authentication. So again, how could I call the service from the UI thread, but have the XML deserialization (internal to the Microsoft.OData.Client lib) done on a different thread? – anomistu Jul 03 '17 at 14:18

0 Answers0