【问题标题】:Best practice use Azure storage in Windows Store最佳实践在 Windows 应用商店中使用 Azure 存储
【发布时间】:2015-08-29 01:44:17
【问题描述】:

我在 Windows 商店中使用 Azure 存储类库。 有一个 DynamicTableEntity 类,但我想像我们在 WPF 中所做的那样继承 TableEntity 类。

那么如何在windows store APP中创建TableEntity类,谁能分享一下代码? 现在我只使用这样的代码:

 public class PictureEntity
{
    private DynamicTableEntity entity;

    public PictureEntity()
    {
        //TODO:This username should be changed to User account in real app
        this.entity = new DynamicTableEntity() { PartitionKey = "UserName", RowKey = DateTime.Now.ToFileTime().ToString() };
    }

    public string Name { 
        get
        {
            return entity.Properties["FileName"].StringValue;
        }
        set
        {
            entity.Properties.Add(new KeyValuePair<string, EntityProperty>("FileName", new EntityProperty(value)));
        }
    }
    public string PictureUrl {
        get
        {
            return entity.Properties["ImageUrl"].StringValue;
        }
        set
        {
            entity.Properties.Add(new KeyValuePair<string, EntityProperty>("ImageUrl", new EntityProperty(value)));
        }
    }

    public string Description
    {
        get
        {
            return entity.Properties["Description"].StringValue;
        }
        set
        {
            entity.Properties.Add(new KeyValuePair<string, EntityProperty>("Description", new EntityProperty(value)));
        }
    }

    public DynamicTableEntity PictureTableEntity { get { return entity; } set {
        entity = value;
    } }
    public StorageFile PictureFile { get; set; }




}

【问题讨论】:

    标签: azure windows-store


    【解决方案1】:

    您可以尝试使用适用于 WinRT 的 Azure 存储客户端库。有关详细信息,请参阅 Microsoft 官方 Azure 文档中的以下文章:

    如何在 Windows 应用商店应用中使用 Azure 存储

    不确定您是否还在寻找 2015 年的答案,但希望对您有所帮助!

    【讨论】:

      猜你喜欢
      • 2010-11-25
      • 1970-01-01
      • 1970-01-01
      • 2014-01-06
      • 2018-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-07
      相关资源
      最近更新 更多