0
我有一個複雜的odata查詢,我使用OdataAngularResrouce庫通過Angular傳遞。我們都知道odata查詢是區分大小寫的,顯然我不知道數據如何存儲在數據庫中。這是我用來構建查詢的謂詞。如何在已經使用函數的情況下過濾大小寫不敏感的查詢?
var predicFirstName = new $odata.Predicate(new $odata.Func("startswith", "FirstName", new $odata.Func("tolower", $scope.searchObject.searchString)), true);
var predicLastName = new $odata.Predicate(new $odata.Func("startswith", "LastName", new $odata.Func("tolower", $scope.searchObject.searchString)));
**OData URI:**
https://localhost/app/TylerIdentityUserAdministrationService/Users/$count/?$filter=((startswith(FirstName,tolower(Fahad)))%20or%20startswith(LastName,tolower(Fahad)))
正如你所看到的,我希望把一個函數只檢查給定的字符串與startswith。我看過幾個帖子,解決方案是放置tolower()。但是,當我按照上面提到的方式進行操作時,它不返回任何數據。任何人都可以幫忙嗎?
由於 -Fahad