Base solution for your next web application
Open Closed

DevExtreme: DataSourceLoader.Load as Async #7469


User avatar
0
leonkosak created

Based on all conversations on GitHub when mixing async and sync code, I would like to know if calling DataSourceLoader.Load in Task is REALLY safe (no thread starvation or other runtime problems possible?

public async Task<object> Get(DataSourceLoadOptions loadOptions)
{  
           object result = await Task.Run(() => DataSourceLoader.Load(SampleData.Orders, loadOptions));  
           return result;  
}

https://www.devexpress.com/Support/Center/Question/Details/T621512/how-to-use-datasourceloader-in-an-async-controller-action

Thank you for explanations.


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @leonkosak

    Couldn't be sure at the moment. But, if there is a problem, you will get ObjectDisposedException.

  • User Avatar
    0
    leonkosak created

    It works (at least we haven't had issues yet). :)