每當我嘗試訪問我的Azure的移動服務表,我得到以下錯誤:將值「AAAAAAAAB9c =」轉換爲鍵入「System.Version」時出錯。路徑「版本」
An exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: Error converting value "AAAAAAAAB9k=" to type 'System.Version'. Path 'version', line 19, position 27.
這是發生這種錯誤的行:
await App.MobileService.GetTable<TodoItem>().InsertAsync(todoItem);
我不實際上需要我的表中的版本值。此值由Azure自動生成。有沒有辦法強制忽略版本值?
這是的TodoItem定義:
public class TodoItem
{
public string Id { get; set; }
public DateTime createdAt { get; set; }
public DateTime updatedAt { get; set; }
public Version version { get; set; }
public bool deleted { get; set; }
... and so on...
}
「TodoItem」的定義是什麼? –
您是否曾嘗試在'TodoItem'類的'Version'屬性中添加'[JsonIgnore]'? –
我已編輯該問題以包含該定義。謝謝! – RockAndaHardPlace