Monday, April 19, 2010

Silverlight 4:The method ‘Skip’ is only supported for sorted input in LINQ to Entities. The method ‘OrderBy’ must be called before the method ‘Skip’.

If you are using default domain service and Linq-to-Entities with silverlight 4, and you want to use data pager for your datagrid, you may end up with the error message above. In order to fix it, just open the corresponding get method for the entity and put .OrderBy("it.[ColumnName]");


[Query(IsDefault = true)]
public IQueryable GetRequests()
{
return this.ObjectContext.Requests.OrderBy("it.RequestID");
}

No comments:

Post a Comment