How can I create a dynamic Select on an IEnumerable at runtime?

后端 未结 3 1618
礼貌的吻别
礼貌的吻别 2020-12-14 12:37

Given that I have an IEnumerable, where T is any object, how can I select a specific property from it, given that I know the name of the o

3条回答
  •  时光取名叫无心
    2020-12-14 13:10

    The dynamic linq library allows you to specify predicates and projections on the fly and may fit your use case-

    http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx

提交回复
热议问题