Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Parent in ContainerBase to OperationsBase type #21872

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected ContainerBase(ArmClientOptions options, TokenCredential credential, Ur
/// Initializes a new instance of the <see cref="ContainerBase"/> class.
/// </summary>
/// <param name="parent"> The resource representing the parent resource. </param>
protected ContainerBase(ResourceOperationsBase parent)
protected ContainerBase(OperationsBase parent)
: base(new ClientContext(parent.ClientOptions, parent.Credential, parent.BaseUri, parent.Pipeline), parent.Id)
{
Parent = parent;
Expand All @@ -63,6 +63,6 @@ protected ContainerBase(ResourceOperationsBase parent)
/// <summary>
/// Gets the parent resource of this resource.
/// </summary>
protected ResourceOperationsBase Parent { get; }
protected OperationsBase Parent { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ protected OperationsBase()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="OperationsBase"/> class.
/// </summary>
/// <param name="parentOperations"> The resource representing the parent resource. </param>
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
protected OperationsBase(OperationsBase parentOperations, ResourceIdentifier id)
: this(new ClientContext(parentOperations.ClientOptions, parentOperations.Credential, parentOperations.BaseUri, parentOperations.Pipeline), id)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="OperationsBase"/> class.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ protected ResourceContainerBase(ResourceOperationsBase parent)
{
}

/// <summary>
/// Gets the parent resource of this resource.
/// </summary>
protected new ResourceOperationsBase Parent { get {return base.Parent as ResourceOperationsBase;} }

/// <summary>
/// Verify that the input resource Id is a valid container for this type.
/// </summary>
Expand Down