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:
You can use dapper, pass as a parameter listCodePudding user response:
EF linq best nested any way, because he is going to generate SQL statements, and once he resolution, will give you a full table, you must be aware of this!Is you it's use in statement,
In statement is the Contains
String [] array=user input. The split (' ');
Var data=https://bbs.csdn.net/topics/_context.aa.where (a=> array. The Contains (a.n ame)). The tolist ();
CodePudding user response:
The worship the next 17 years bossesCodePudding user response: