Azure移动服务Android离线示例-"createdAt","updatedAt"列为空 [英] Azure Mobile Services Android Offline Example - "createdAt","updatedAt" columns empty

查看:45
本文介绍了Azure移动服务Android离线示例-"createdAt","updatedAt"列为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在移动设备的本地数据库的ToDoItem表中添加了列"createdAt"和"updatedAt",因为它们也存在于Azure数据库ToDoItem表中.尽管我刷新了列表(其他表的列都正常更新),但这些列从未在localstorage表中更新.为什么会发生这种情况?我遵循的示例在这里:解决方案

在未看到任何代码的情况下,我假设您尚未用相应的注释修饰CreatedAt和UpdatedAt属性.确保您的媒体资源看起来像这样并且可以正常工作:

  [Microsoft.WindowsAzure.MobileServices.CreatedAt]公共DateTimeOffset?CreatedAt {get;放;}[Microsoft.WindowsAzure.MobileServices.UpdatedAt]公共DateTimeOffset?UpdatedAt {get;放;} 

Ps.您不必在不使用它们的情况下添加这些列.

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. Those columns are never updated in the localstorage table although i refresh the list (the other table columns are updated normally). 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/

Thank you

解决方案

Without having seen any of your code I assume you haven't decorated the CreatedAt and UpdatedAt properties with the corresponding annotations. 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.

这篇关于Azure移动服务Android离线示例-"createdAt","updatedAt"列为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆