Kendo ui 检测到类型不兼容的二进制运算符。找到运算符类型“Equal”的操作数类型“Edm.Guid”和“Edm.String”。小田2.2

Kendo ui 检测到类型不兼容的二进制运算符。找到运算符类型“Equal”的操作数类型“Edm.Guid”和“Edm.String”。小田2.2,kendo-ui,odata,Kendo Ui,Odata,剑道过滤器 if ($.trim(DepartmentId)) { $filter.push({ field: "DepartmentId", operator: "eq", value: DepartmentId }); } 模型 public System.Guid DepartmentId { get; set; } 方法 [Queryable] public IQueryable<Employee> Get(ODataQueryOptions opts)

剑道过滤器

if ($.trim(DepartmentId)) { $filter.push({ field: "DepartmentId", operator: "eq", value: DepartmentId  }); }
模型

public System.Guid DepartmentId { get;  set; }
方法

[Queryable]
    public IQueryable<Employee> Get(ODataQueryOptions opts)
    {
        EmployeeService.HrEmployeeServiceFacadeClient emp = new EmployeeService.HrEmployeeServiceFacadeClient();
        var response = emp.GetAll();
        List<Employee> result = JsonConvert.DeserializeObject<List<Employee>>(response.Result);
        var resultString = result.AsQueryable();

        return resultString;
    }
我用的是OData2.2

它的显示错误


检测到类型不兼容的二进制运算符。找到运算符类型“Equal”的操作数类型“Edm.Guid”和“Edm.String”。

在OData v2中,文字Guid必须序列化为Guid“dddddd-dddddd-dddddddddd-dddddddddddddddd”,其中每个d表示一个十六进制数字。

在OData v2中,文字GUID必须序列化为GUID“dddddd-dddddd-dddd-dddddd-dddddddd”,其中每个d代表一个十六进制数字。

无效的“where”条件。实体成员正在调用无效的属性或方法。,/AccountSet?$filter=AccountId eq guid'03a0a47b-e3a2-e311-9402-00155d104c22'invalid'where'条件。实体成员正在调用无效的属性或方法。,/AccountSet?$filter=AccountId eq guid'03a0a47b-e3a2-e311-9402-00155d104c22'