我正在编写实现关键字样式搜索的 LINQ 查询。换句话说,一个查询返回其Title, Description,Id包含的行
如下
public static IQueryable<EmployeeObject> QueryableSQL()
{
IQueryable<EmployeeObject> queryable = EmployeeRepository.GetAllEmployee();
}
public static IList<EmployeeObject> QLike(string txt)
{
IList<employeeObject> _emps = QueryableSQL().Where(x => x.Title == txt).ToList();
return _emps;
}
到目前为止,一切都很好。但这仅处理您想在我的情况下匹配的情况Title。
假设相反,我想根据“描述orIDshould i have to create a new method for Description? or is there a way i can create a树表达式”进行搜索