2017-03-05 90 views
0

我有一个工作的Azure应用程序使用SQLiteStore,但每当我将PullAsync的查询更改为具有Where子句的东西时,它会给我一个“该请求无法完成。 )“例外。该请求无法完成。 (错误的请求)为PullAsync

数据库中存在现有数据。

作品:

await syncTable.PullAsync("id", syncTable.CreateQuery(), false, new CancellationToken(), new PullOptions()); 

不起作用:

await syncTable.PullAsync("id", syncTable.Where(w => w.otherTableId=="dkdkdkdkd"), false, new CancellationToken(), new PullOptions()); 

不起作用:

这是什么原因?

回答

1

我能够通过添加一个Column属性并将“otherTableId”更改为服务器端代码上的“OtherTableId”来完成此工作。

不知道为什么服务器端代码期待的大写字母O “OtherTableId”

public class SomeTable : EntityData 
{ 
     [Column("otherTableId")] 
     public string OtherTableId { get; set; } 
} 

提琴手跟踪:

HTTP/1.1 400错误的请求 的Content-Length:151 内容类型:application/json;字符集= UTF-8 服务器:IIS/8.0 X供电-通过:ASP.NET 日期:星期五,2017年3月10日3时36分28秒GMT

{ “消息”:“指定的查询在URI中无效。在类型'Backend.DataObjects.SomeTable'上找不到名为'OtherTableId'的属性。“}

GET https://XXXX.azurewebsites.net/tables/SomeTable?$ filter =((otherTableId%20eq%20'dkdkdkdkd')% 20于是%20(updatedAt%如20Ge%20datetimeoffset'1970-01-01T00%3A00%3A00.0000000%2B00%3A00' ))& $的OrderBy = updatedAt & $跳过= 0 & $顶= 50 & __includeDeleted =真

+0

您使用哪个Nuget获取服务器上的“Column”属性? –

+0

@JoakimM using System.ComponentModel.DataAnnotations.Schema; –