你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
NamespaceManager.GetTopics 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
GetTopics() |
检索服务命名空间中的主题集合。 |
GetTopics(String) |
检索具有指定筛选器的服务命名空间中的主题集合。 可以按实体名称 (的组合进行筛选,包括以) 开头、实体长度 (Gt 或 Lt) 、创建、更新和访问时间 (Gt 或 Lt) 。 |
GetTopics()
检索服务命名空间中的主题集合。
public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.TopicDescription> GetTopics ();
member this.GetTopics : unit -> seq<Microsoft.ServiceBus.Messaging.TopicDescription>
Public Function GetTopics () As IEnumerable(Of TopicDescription)
返回
一个 IEnumerable<T> 对象,该对象表示当前命名空间下的主题集合,如果不存在主题,则返回空集合。
例外
操作超时。超时期限通过 NamespaceManagerSettings 类初始化。 如果超时值相对较低, OperationTimeout 可能需要增加 属性的值以避免此异常。
对象 NamespaceManager 没有足够的权限来执行此操作。 应检查,以确保 具有NamespaceManager执行此操作的正确TokenProvider凭据。
发生内部错误或意外异常。
适用于
GetTopics(String)
检索具有指定筛选器的服务命名空间中的主题集合。 可以按实体名称 (的组合进行筛选,包括以) 开头、实体长度 (Gt 或 Lt) 、创建、更新和访问时间 (Gt 或 Lt) 。
public System.Collections.Generic.IEnumerable<Microsoft.ServiceBus.Messaging.TopicDescription> GetTopics (string filter);
member this.GetTopics : string -> seq<Microsoft.ServiceBus.Messaging.TopicDescription>
Public Function GetTopics (filter As String) As IEnumerable(Of TopicDescription)
参数
- filter
- String
用于筛选要检索的主题的字符串。
返回
一个 IEnumerable<T> 对象,该对象表示当前命名空间下的主题集合,如果不存在主题,则返回空集合。
示例
var topicsWithMessages = namespaceManager.GetTopics("messageCount Gt 0");
var topicsStartsWith = namespaceManager.GetTopics($"startswith(path, 'topic') eq true");
注解
筛选表达式格式: {Propery} {Logical Operator} {Value} 和 {Filter expression} {Function} {Logical Operator} {Value} AND {Filter expression} ----------------------------------------------------------------------------------------- 可用属性: Path |ModifiedAt |AccessedAt |CreatedAt |MessageCount 逻辑运算符:Eq |Ne |Gt |Ge |Lt |Le Value:相应属性类型的值 Functions: startswith ({Propery}, {Value})