Dynamically select property in Linq query

前端 未结 3 1170
孤街浪徒
孤街浪徒 2021-01-21 19:15

I am facing one issue with linq query in c# , my linq query as per below

list = (from row in dt.AsEnumerable()
                            select new Perfmon
            


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 19:57

    You can also use Dynamic Linq. The essence is to parse your string and convert it in to expression trees. See here for more details

    http://weblogs.asp.net/rajbk/archive/2007/09/18/dynamic-string-based-queries-in-linq.aspx

提交回复
热议问题