How do I implement a dynamic 'where' clause in LINQ?

后端 未结 7 2109
有刺的猬
有刺的猬 2020-12-29 09:57

I want to have a dynamic where condition.

In the following example:

var opportunites =  from opp in oppDC.Opportunities
                        


        
7条回答
  •  悲&欢浪女
    2020-12-29 10:41

    The following questions and answers address this quite well:

    Dynamic where clause in LINQ - with column names available at runtime
    Is there a pattern using Linq to dynamically create a filter?

提交回复
热议问题