Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我使用了StartsWith,但它不能通过linq在azure cosmosDB文档中工作_Linq_Azure Cosmosdb Sqlapi - Fatal编程技术网

我使用了StartsWith,但它不能通过linq在azure cosmosDB文档中工作

我使用了StartsWith,但它不能通过linq在azure cosmosDB文档中工作,linq,azure-cosmosdb-sqlapi,Linq,Azure Cosmosdb Sqlapi,我使用STARTSWITH通过linq过滤记录,从azure cosmos db获取数据。但它总是将记录计数显示为零 用于获取数据的查询: var locs=来自数据 在不同地点 where data.Properties.Street.ToLower().StartsWith(“胸部”) 选择数据; 以下是来自文档数据库的示例: { "type": "Feature", "geometry": { "type": "Point", "coor

我使用STARTSWITH通过linq过滤记录,从azure cosmos db获取数据。但它总是将记录计数显示为零

用于获取数据的查询:

var locs=来自数据
在不同地点
where data.Properties.Street.ToLower().StartsWith(“胸部”)
选择数据;

以下是来自文档数据库的示例:

{
    "type": "Feature",
    "geometry": {
        "type": "Point",
        "coordinates": [
            -0.141246,
            51.56292
        ]
    },
    "properties": {
        "city": "london",
        "countryCode": "GB",
        "parkingType": "permit holders only",
        "approxNoOfSpaces": 4,
        "timesOfOperation": "mon-fri 10:00-12:00",
        "maximumStay": "N/A",
        "tariff": "N/A",
        "cashlessIdentifier": "N/A",
        "nearestMachine": "N/A",
        "street": "Chester Road",
        "postcode": "N19 5DE",
        "controlledParkingZone": "CA-U",
        "validParkingPermits": "CA-U",
        "parkingBayLengthMetres": 19,
        "disclaimer": "The information provider and/ or licensor are not liable for any errors or omissions contained within this dataset and shall not be liable for any loss, injury or damage caused by its use.",
        "easting": 528937,
        "northing": 186530,
        "EPSG:27700 Well Known Text Geometry": "LINESTRING (528943.9746311313 186522.8076569282,528944.9970187079 186524.33721909559,528929.9827624428 186537.32350181084,528928.7624933998 186535.9039081653)",
        "EPSG:4326 Well Known Text Geometry": "LINESTRING (-0.14114833166779203 51.56285353559299,-0.14113302974759298 51.56286704785321,-0.14134475707247782 51.56298717904703,-0.14136287187179347 51.56297470018317)",
        "externalFeatureId": 46044821,
        "spatialAccuracy": "Defined By Custodian",
        "lastUploaded": "07/08/2019 11:01:52 PM",
        "location": "(51.56292, -0.141246)",
        "organisationURI": "http://opendatacommunities.org/id/london-borough-council/camden",
        ":@computed_region_hxwp_gyfc": 10,
        ":@computed_region_6i9a_26nj": 66
    },
    "documentType": "location",
    "id": "********************",
    "_rid": "*******************",
    "_self": "****************************",
    "_etag": "*****************************",
    "_attachments": "********************",
    "_ts": 1565344913
}

一旦你把“切斯特路”改成小写,它就不再以“胸部”开头,而是以“胸部”开头。你试过用“胸部”作为开始的理由吗?是的,我试过了。但它不起作用实际上,当我们将STARTSWITH与属性类型一起使用时,它起作用,但在属性上不起作用。street。。。它不适用于内部对象