C# Linq where clause as a variable

后端 未结 5 743
后悔当初
后悔当初 2020-12-01 07:30

I am trying to make a LINQ statement where the where clause comes from a variable. For example:

string whereClause = address.zip == 23456;
var x = from somet         


        
5条回答
  •  醉酒成梦
    2020-12-01 08:02

    That's a built-in Feature of LINQ. Just use the Where extension method.

    See LINQ Query Syntax versus Method Syntax (C#) for more information.

提交回复
热议问题