How to check for the presence of an OrderBy in a ObjectQuery expression tree

后端 未结 6 1021
礼貌的吻别
礼貌的吻别 2020-12-09 07:09

I\'m using T4 for generating repositories for LINQ to Entities entities.

The repository contains (amongst other things) a List method suitable for paging. The docum

6条回答
  •  时光说笑
    2020-12-09 07:31

    I have implemented a solution that sorts whatever collection by its primary key as the default sort order is not specified. Perhaps that will work for you.

    See http://johnkaster.wordpress.com/2011/05/19/a-bug-fix-for-system-linq-dynamic-and-a-solution-for-the-entity-framework-4-skip-problem/ for the discussion and the general-purpose code. (And an incidental bug fix for Dynamic LINQ.)

提交回复
热议问题