简体   繁体   English

Azure移动服务Android离线示例-“ createdAt”,“ updatedAt”列为空

[英]Azure Mobile Services Android Offline Example - “createdAt”,“updatedAt” columns empty

i have added in the ToDoItem table of the local DB of the mobile device the columns "createdAt" and "updatedAt", because they also exist in the Azure Database ToDoItem table. 我在移动设备的本地数据库的ToDoItem表中添加了“ createdAt”和“ updatedAt”列,因为它们也存在于Azure数据库ToDoItem表中。 Those columns are never updated in the localstorage table although i refresh the list (the other table columns are updated normally). 尽管我刷新了列表(其他表的列都正常更新),但这些列从未在localstorage表中更新。 Why could this happen? 为什么会发生这种情况? The example i followed is here: http://azure.microsoft.com/blog/2014/08/07/offline-support-in-azure-mobile-services-android-sdk/ 我遵循的示例在这里: http : //azure.microsoft.com/blog/2014/08/07/offline-support-in-azure-mobile-services-android-sdk/

Thank you 谢谢

Without having seen any of your code I assume you haven't decorated the CreatedAt and UpdatedAt properties with the corresponding annotations. 在没有看到任何代码的情况下,我假设您没有用相应的注释修饰CreatedAt和UpdatedAt属性。 Make sure your properties look like this and it should work: 确保您的媒体资源看起来像这样并且可以正常工作:

    [Microsoft.WindowsAzure.MobileServices.CreatedAt]
    public DateTimeOffset? CreatedAt { get; set; }

    [Microsoft.WindowsAzure.MobileServices.UpdatedAt]
    public DateTimeOffset? UpdatedAt { get; set; }

Ps. 附言 you don't have to add these columns of your aren't using them. 您不必添加这些没有使用的列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM