Thanks for the housekeeping, Ben, I appreciate it!
Adding details from my original private support ticket.
Our application is logging many warnings of the form:
The query uses a row limiting operator ('Skip'/'Take') without an 'OrderBy' operator. This may lead to unpredictable results. If the 'Distinct' operator is used after 'OrderBy', then make sure to use the 'OrderBy' operator after 'Distinct' as the ordering would otherwise get erased.
I have tracked this down to queries where we are using .ToDataSourceResult() (e.g. for server-paged Telerik data grids).
I note that the expected behaviour appears to be that this will sort by the first sortable member if no sort descriptors are provided. However, this is only applied when the LINQ provider is Entity Framework. We are using EF Core - I would have expected that the behaviour would be consistent here?
The Telerik DataSource code checks the provider name like so:
public static bool IsEntityFrameworkProvider(this IQueryProvider provider)
{
string fullName = provider.GetType().FullName;
if (!(fullName == "System.Data.Objects.ELinq.ObjectQueryProvider") && !(fullName == "System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider") && !fullName.StartsWith("LinqKit.ExpandableQueryProvider") && !fullName.StartsWith("Microsoft.Data.Entity.Query.EntityQueryProvider"))
{
return fullName.StartsWith("System.Data.Entity.Internal.Linq");
}
return true;
}
However, in EF Core the provider name is:
"Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider"
And therefore Telerik's current code does not detect EF Core correctly.