我有一个看起来像这样的对象
class MyObject
{
string Name;
string Description;
List<string> Keywords;
}
当我搜索这些时,我有一个List<MyObject> AllObjects
,我想根据Keywords
var query = Request["q"];
//will only return exact matches
var exactHits = GetAll().Where(x => x.Keywords.Contains(query));
//I want something like this
var searchHits = GetAll().Where(x => x.Keywords.Contains(Regex.Match(query)));