diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ContainerBase.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ContainerBase.cs
index 74f5ad739b67..bbd1df865047 100644
--- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ContainerBase.cs
+++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ContainerBase.cs
@@ -54,7 +54,7 @@ protected ContainerBase(ArmClientOptions options, TokenCredential credential, Ur
/// Initializes a new instance of the class.
///
/// The resource representing the parent resource.
- protected ContainerBase(ResourceOperationsBase parent)
+ protected ContainerBase(OperationsBase parent)
: base(new ClientContext(parent.ClientOptions, parent.Credential, parent.BaseUri, parent.Pipeline), parent.Id)
{
Parent = parent;
@@ -63,6 +63,6 @@ protected ContainerBase(ResourceOperationsBase parent)
///
/// Gets the parent resource of this resource.
///
- protected ResourceOperationsBase Parent { get; }
+ protected OperationsBase Parent { get; }
}
}
diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs
index 339722d4c502..a30a545fcbbd 100644
--- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs
+++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/OperationsBase.cs
@@ -20,6 +20,16 @@ protected OperationsBase()
{
}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The resource representing the parent resource.
+ /// The identifier of the resource that is the target of operations.
+ protected OperationsBase(OperationsBase parentOperations, ResourceIdentifier id)
+ : this(new ClientContext(parentOperations.ClientOptions, parentOperations.Credential, parentOperations.BaseUri, parentOperations.Pipeline), id)
+ {
+ }
+
///
/// Initializes a new instance of the class.
///
diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs
index 482b10d81162..18c1f368e391 100644
--- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs
+++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/ResourceContainerBase.cs
@@ -48,6 +48,11 @@ protected ResourceContainerBase(ResourceOperationsBase parent)
{
}
+ ///
+ /// Gets the parent resource of this resource.
+ ///
+ protected new ResourceOperationsBase Parent { get {return base.Parent as ResourceOperationsBase;} }
+
///
/// Verify that the input resource Id is a valid container for this type.
///