开发者

Error adding dynamic data to an existing site - 'Skip' is only supported for sorted input in LINQ to Entities. 'OrderBy' must be called before 'Skip'

I am creating an ASP.NET web site which will support dynamic data.开发者_Go百科 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'.

How do I prevent this error?


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);


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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜