我有如下 JSON 数组。
[
{
"_Id": "0001",
"_PatentId": "0000",
"_Text": "Employee",
"_Value": "employee",
"_PermissionLevel": 55
},
{
"_Id": "0002",
"_PatentId": "0000",
"_Text": "Employees",
"_Value": "employees",
"_PermissionLevel": 55
},
{
"_Id": "0002",
"_PatentId": "0001",
"_Text": "Dept",
"_Value": "Dept",
"_PermissionLevel": 55
}
]
使用这个 JSON 数组,我需要使用 like 运算符过滤员工。我在下面使用了查询,它工作正常。
var qryResult = Enumerable.From(_gramrTree).Where("$._Text == 'Employee'").OrderBy("$._Id").Select("$._Id").ToArray();
但我需要与类似的运营商合作..但它不起作用..
不成功的查询
var qryResult = Enumerable.From(_gramrTree).Where("$._Text like '%Emp%'").OrderBy("$._Id").Select("$._Id").ToArray();
var qryResult = Enumerable.From(_gramrTree).Where("$._Text % 'Emp'").OrderBy("$._Id").Select("$._Id").ToArray();