Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何插入属性长度超过32kB的Azure Storage TableEntity_C#_Azure_Azure Table Storage - Fatal编程技术网

C# 如何插入属性长度超过32kB的Azure Storage TableEntity

C# 如何插入属性长度超过32kB的Azure Storage TableEntity,c#,azure,azure-table-storage,C#,Azure,Azure Table Storage,当我有一个类继承自TableEntity,并使用以下构造函数时: public CacheEntity(string cacheType, string key, string value) { this.PartitionKey = cacheType; this.RowKey = key; this.Value = value; } 当postsData长度超过32768个字符时,我执行如下插入操作: CacheEntity entity = new CacheEn

当我有一个类继承自
TableEntity
,并使用以下构造函数时:

public CacheEntity(string cacheType, string key, string value) {
    this.PartitionKey = cacheType;
    this.RowKey = key;
    this.Value = value;
}
当postsData长度超过32768个字符时,我执行如下插入操作:

CacheEntity entity = new CacheEntity(CacheType.CategoryPosts, cacheKey, postsData.Substring(0, 32769));
TableOperation insertCacheOperation = TableOperation.Insert(entity);
await cacheTable.ExecuteAsync(insertCacheOperation);

ExecuteAsync
方法返回错误请求

表存储文档说明

通过将
postsData
截断为32768,我可以成功执行
ExecuteAsync
,例如

CacheEntity entity = new CacheEntity(CacheType.CategoryPosts, cacheKey, postsData.Substring(0, 32768));

是否有一个简单的修复程序允许TableEntity属性中的数据超过32KB?

找到的所有属性都有一个最大大小,但每个属性也有一个最大大小。根据报告:

字符串值的大小可能高达64 KB。请注意,支持的最大字符数约为32 K或更少