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或更少