Unable to sort with property name in LINQ OrderBy

后端 未结 3 1409
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 20:55

Error is

LINQ to Entities does not recognize the method \'System.Object GetValue(System.Object, System.Object[])\' method, and this method ca

3条回答
  •  被撕碎了的回忆
    2020-12-14 21:45

    You will probably need to use Expression Trees to construct the Linq statement OrderBy(x => x.SomeProperty).

    Create an OrderBy Expression for LINQ/Lambda

    Create LINQ to entities OrderBy expression on the fly

提交回复
热议问题