views:

306

answers:

2

Hello All:

I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error

"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "

Please help

Thanks Vinay

A: 

That error is actually very descriptive- it means exactly what it says. Use the OrderBy extension method to sort the result set by any property and the Skip and Take extension methods will work.

var foo = from e in MyEntities.SomeEntity.OrderBy(x=>x.SomeProperty).Skip(100);
Dave Swersky
I am no where using Skip method in my code, the whole code is auto generated..
Vinni
The Skip method must be in there somewhere... search your code for "Skip"
Dave Swersky
Which totally doesn't work if you don't know ahead of time what the incoming entity is.
George R
+1 for Dave Swersky's comment. It made me laugh.
Dr. Zim
A: 

Okay...I got the answer, the problem was with the DynamicData folder it creaed, when we use LinqtoSQL with Dynamic data it creates different type of DynamicData folder and when we use LinqToEntity it creates another type of DynamicData folder..

Tahnks guys..

Vinni