小编Jar*_*rde的帖子

如何告诉Azure表存储不存储某些实体属性

鉴于以下课程

public class Account : TableEntity
{
    public Account()
    {

    }
    public Account(string customerName, string username)
    {
        PartitionKey = customerName;
        RowKey = username;
    }

    public string FullName { get; set; }

    public string CustomerName
    {
        get
        {
            return PartitionKey;
        }
        set
        {
            PartitionKey = value;
        }
    }

    public string UserName
    {
        get
        {
            return RowKey;
        }
        set
        {
            RowKey = value;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

如您所见,我在代码库中添加了两个包装RowKey和PartitionKey的属性,以提高可读性和便利性。问题是这些属性也存储在我不想要的Azure存储的表中。

我尝试使用NotMapped属性,但是在这种情况下似乎不起作用。有任何想法吗?

azure nosql azure-storage

1
推荐指数
1
解决办法
285
查看次数

标签 统计

azure ×1

azure-storage ×1

nosql ×1