From e3c3b8cd92c03ba3479bc2d456aefb088293ce90 Mon Sep 17 00:00:00 2001 From: Feng Zhou <55177366+fengzhou-msft@users.noreply.github.com> Date: Wed, 14 Jul 2021 13:51:43 +0800 Subject: [PATCH] make Types public (#22612) --- .../src/ResourceIdentifier/ResourceIdentifier.cs | 2 +- .../src/ResourceIdentifier/ResourceType.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceIdentifier.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceIdentifier.cs index 82a9ff1800bd8..c14cf1ba9fff1 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceIdentifier.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceIdentifier.cs @@ -428,7 +428,7 @@ internal virtual string ToResourceString() StringBuilder builder = new StringBuilder(Parent.ToResourceString()); if (IsChild) { - builder.Append($"/{ResourceType.Types.Last()}"); + builder.Append($"/{ResourceType.Types[ResourceType.Types.Count - 1]}"); if (!string.IsNullOrWhiteSpace(Name)) builder.Append($"/{Name}"); } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceType.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceType.cs index 660389434aa4c..4dc59237380a4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceType.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceIdentifier/ResourceType.cs @@ -63,7 +63,10 @@ internal ResourceType(ResourceType parent, string childType) /// public string Type { get; private set; } - internal IList Types { get; } = new List(); + /// + /// Gets the resource Types. + /// + public IReadOnlyList Types { get; } = new List(); /// /// Determines if this resource type is the parent of the given resource.