Dynamically build select list from linq to entities query

前端 未结 3 1704
挽巷
挽巷 2020-12-13 22:21

I\'m looking for a way to dynamically create a select list from a iQueryable object.

Concrete example, i want to do something like the following:

pub         


        
3条回答
  •  醉酒成梦
    2020-12-13 23:16

    What you are going for is possible, but it's not simple. You can dynamically build EF queries using the methods and classes in the System.Linq.Expressions namespace.

    See this question for a good example of how you can dynamically build your Select expression.

提交回复
热议问题