This is a migrated thread and some comments may be shown as answers.

async methods in the toDataSource() call?

3 Answers 859 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Veteran
Bob asked on 15 Aug 2018, 05:22 PM

I have already raised an issue on Stack Overflow about this and it is worth extending my enquiries here before my head explodes from the constant banging against my desk...
It's a simple question which will allow me to refactor my code (or not) before I pass an IQueryable to the toDataSource() method.

Does toDataSource() use async methods internally?

I am having problems with second operation on the context with a nested code block called from within my IQueryable.  The Stack Overflow post will explain in more depth.

Thanking anyone who can help in advance!

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Aug 2018, 08:14 AM
Hello, Bob,

There is an async toDataSourceResult, but that is a separate method which was introduced later.

"As of the Kendo UI R1 2017 SP1 release, you can use the ToDataSourceResultAsync extension method to provide the asynchronous functionality of ToDataSourceResult by leveraging the async and await features of the .NET Framework"

The default ToDataSourceResult method is not async.

This is its implementation which can prove helpful as it will show what is done under the hood and it can be debugged:

public static DataSourceResult ToDataSourceResult(this IQueryable queryable, DataSourceRequest request)
{
    return queryable.ToDataSourceResult(request, null);
}

I hope this will help with the investigation.

If it does not, please share an example which we can test locally to determine the issue.

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bob
Top achievements
Rank 1
Veteran
answered on 16 Aug 2018, 03:12 PM

Hi Stefan,

Thanks.  Your reply allowed me to move on to other areas of research, I tried changing to sync and asynch all the way through the process and I don't believe it anything to do with the toDataSource() method of Kendo.  I am now investigating iteration of queryables but I may be going down another blind alley!

Thanks anyways,
Bob

0
Stefan
Telerik team
answered on 17 Aug 2018, 07:49 AM
Hello, Bob,

I`m glad that we could be of any help even a small one in this case.

As this is indeed a very complex case, we will stay on ready if you need further assistance.

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Bob
Top achievements
Rank 1
Veteran
Share this question
or