Home > Net >  LINQ query more conditions
LINQ query more conditions

Time:04-27

I am using asp.net + EF

Table structure
Id name sex...

Front desk has an input box, now need to enter more "space" as the separator name query conditions

Var aa=the from s in _context. Aa
Select the s;

Aa=aa. The Where (s=& gt; S.n ame. The Contains (searchString))


Originally a condition can be used directly to query the Contains

Now if the input/other, test users, this kind of condition, how to write this expression

CodePudding user response:

String [] STR={test users other}
Aa=aa. The Where (s=& gt; STR. The Contains (s.n ame))

CodePudding user response:

String [] STR={" test ", "user", "other"};

Aa=aa. The Where (s=& gt; STR. The Contains (s.n ame))

In this way, after filtering, the data also did not have the

CodePudding user response:

  •  Tags:  
  • LINQ
  • Related