ValidateResourceIds() private method

Validates a whole array of resource IDs, including that the count matches.
private ValidateResourceIds ( string resourceIds ) : void
resourceIds string
return void
コード例 #1
0
 /// <summary>
 /// Creates a resource name with the given template and resource IDs.
 /// The resource IDs are cloned, so later changes to <paramref name="resourceIds"/>
 /// are ignored. This constructor does not populate the <see cref="ServiceName"/> property,
 /// but that can be set after construction.
 /// </summary>
 /// <param name="template">The template for the new resource name. Must not be null.</param>
 /// <param name="resourceIds">The resource IDs to populate template parameters with. Must not be null.</param>
 public TemplatedResourceName(PathTemplate template, params string[] resourceIds)
 {
     Template = GaxPreconditions.CheckNotNull(template, nameof(Template));
     GaxPreconditions.CheckNotNull(resourceIds, nameof(resourceIds));
     // This is a somewhat annoying defensive copy. Given that we're usually going to just call ToString()
     // on the ResourceName, we don't really need the cloned array, or even the ResourceName itself.
     _resourceIds = (string[])resourceIds.Clone();
     template.ValidateResourceIds(_resourceIds);
 }
コード例 #2
0
ファイル: ResourceName.cs プロジェクト: googleapis/gax-dotnet
 /// <summary>
 /// Creates a resource name with the given template and resource IDs.
 /// The resource IDs are cloned, so later changes to <paramref name="resourceIds"/>
 /// are ignored. This constructor does not populate the <see cref="ServiceName"/> property,
 /// but that can be set after construction.
 /// </summary>
 /// <param name="template">The template for the new resource name. Must not be null.</param>
 /// <param name="resourceIds">The resource IDs to populate template parameters with. Must not be null.</param>
 public ResourceName(PathTemplate template, params string[] resourceIds)
 {
     Template = GaxPreconditions.CheckNotNull(template, nameof(Template));
     GaxPreconditions.CheckNotNull(resourceIds, nameof(resourceIds));
     // This is a somewhat annoying defensive copy. Given that we're usually going to just call ToString()
     // on the ResourceName, we don't really need the cloned array, or even the ResourceName itself.
     _resourceIds = (string[]) resourceIds.Clone();
     template.ValidateResourceIds(_resourceIds);
 }