0
我在我的MVC項目中使用Azure移動服務。我想獲取由CreatedAt
(這是一個Azure Table中的系統屬性)使用Azure移動服務獲取系統屬性「CreatedAt」過濾的數據
以下過濾記錄是我使用的代碼:
IMobileServiceTable<QuestionItem> bussinessQuestionItemTable =
CustomDeclaration.MobileService.GetTable<QuestionItem>();
queryToPass = "$filter=__createdAt ge datetime'2014-10-25T04:06:27Z'";
var coll = await bussinessQuestionItemTable.ReadAsync(queryToPass);
它總是會拋出異常The request could not be completed. (Bad Request)
用的StatusCode:400
我嘗試了與我們創建的DateTime
字段相同的查詢,它工作正常,但它總是失敗CreatedAt
任何幫助表示讚賞。
它的工作使用的查詢字符串,但無法與Lambda表達式 – 2014-11-13 05:29:57
它是如何失敗的客戶端上是如何定義你的類型 – carlosfigueira 2014-11-13 05:31:16
感謝卡洛斯,它使用查詢字符串,但與Lambda Ex。失敗當使用Lambda Ex時,我發現其形成的RequestUri在字符串中包含「datetime」而不是「datetimeoffset」。 這裏是它 - 「https://abc.azure-mobile.net/tables/QuestionItem?$filter=(__createdAt GE datetime'2014-10-24T22:36:27.000Z')&__ systemproperties = __ createdAt%2C__updatedAt」 我試着傳遞相同的查詢字符串替換datetime與datetimeoffset,它的工作。這裏是我使用的查詢 - 「$ filter =(__ createdAt ge datetimeoffset'2014-10-24T22:36:27.000Z')&__ systemproperties = __ createdAt%2C__updatedAt」 – 2014-11-13 05:37:55