Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

IPartitionResolver 接口

定义

注意

Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.

这表示数据库的分区解析程序。 给定分区键后,返回集合链接 () 与 Azure Cosmos DB 服务中的分区键匹配。

[System.Obsolete("Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.")]
public interface IPartitionResolver
[<System.Obsolete("Support for IPartitionResolver is now obsolete. It's recommended that you use partitioned collections for higher storage and throughput.")>]
type IPartitionResolver = interface
Public Interface IPartitionResolver
派生
属性

注解

对 IPartitionResolver 的支持现已过时。 建议使用 分区集合 提高存储和吞吐量。

DocumentClient 允许为每个数据库创建和注册 IPartitionResolvers 实现。 注册后,可以直接对数据库而不是集合执行文档操作。 IPartitionResolvers 只有三种方法 ExtractPartitionKey、ResolveForCreate 和 ResolveForRead。

LINQ 查询和 ReadFeed 迭代器在内部使用 ResolveForRead 来循环访问与请求的分区键匹配的所有集合。 同样,创建操作使用 ResolveForCreate 将创建路由到正确的分区。 无需对“替换”、“删除”和“读取”进行更改,因为它们使用文档,该文档已包含对保存文档的集合的引用。

方法

GetPartitionKey(Object)
已过时.

从 Azure Cosmos DB 服务中的文档中提取分区键。

ResolveForCreate(Object)
已过时.

给定分区键后,这将返回集合自链接,用于在 Azure Cosmos DB 服务中创建文档。

ResolveForRead(Object)
已过时.

给定分区键后,这将返回要从中读取的集合自链接列表。

适用于