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

Default behavior for ToDataSource changed in 2013.3.1316

4 Answers 67 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 21 Jan 2014, 02:42 AM
Hi Guys!

I have just recently updated my web application project MVC5 EF6 from kendo 2013.3.1119 to 2013.3.1316 and have noticed default behavior changed when calling ToDataSourceResult  on a EF table value mapped function.
Previously when calling ToDataSourceResult without any  SortDescriptors the order will be applied on first column. But in current version when calling ToDataSourceResult without any SortDescriptors it no longer adds order by first column.

Would like to know if this recent change is a feature or not ?

Cheers!


4 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 22 Jan 2014, 04:12 PM
Hello Cornel,

There are not any changes that we have made to change this behavior. The code remains the same and it looks like this:

            if (!sort.Any() && queryable.Provider.IsEntityFrameworkProvider())
            {
                // The Entity Framework provider demands OrderBy before calling Skip.
                SortDescriptor sortDescriptor = new SortDescriptor
                {
                    Member = queryable.ElementType.FirstSortableProperty()
                };
                sort.Add(sortDescriptor);
                temporarySortDescriptors.Add(sortDescriptor);
            }
 
// where IsEFProvider method looks like this
 
        public static bool IsEntityFrameworkProvider(this IQueryProvider provider)
        {
            return provider.GetType().FullName == "System.Data.Objects.ELinq.ObjectQueryProvider" ||
                provider.GetType().FullName.StartsWith("System.Data.Entity.Internal.Linq");
        }


Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
IT
Top achievements
Rank 1
answered on 23 Jan 2014, 02:52 AM
Hi Petur,

Great but can we bring that code up to date so that it works with EF6 too ?
In EF6 the return type is System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.

Cheers!

0
Accepted
Atanas Korchev
Telerik team
answered on 24 Jan 2014, 11:10 AM
Hello Cornel,

Yes, we will update our code to reflect the change in the EF provider name. The fix will be available next week.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
IT
Top achievements
Rank 1
answered on 24 Jan 2014, 02:14 PM
Hi Atanas,
Great to hear and looking forward to the fix. Cheers!
Tags
General Discussions
Asked by
IT
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
IT
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or