Skip to content

Commit 759d791

Browse files
committed
Expose parent resource reference internally
Allow inheriting classes, such as a vendor extension, and us internally to set the parent resource reference. Anyone but the consuming user. It's not needed to access for testing, if properly using HttpTest, as the classes will all be deserialized and initialized by the ApiBuilder.
1 parent 6fcad13 commit 759d791

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/corelib/Compute/v2_1/ImageMetadata.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public class ImageMetadata : Dictionary<string, string>, IHaveExtraData, IChildR
2323

2424
object IServiceResource.Owner { get; set; }
2525

26-
internal void SetParent(ImageReference parent)
26+
/// <summary />
27+
protected internal void SetParent(ImageReference parent)
2728
{
2829
Image = parent;
2930
}

src/corelib/Compute/v2_1/Server.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public string AdminPassword
190190
[OnDeserialized]
191191
private void OnDeserializedMethod(StreamingContext context)
192192
{
193-
foreach (IChildResource volume in AttachedVolumes)
193+
foreach (var volume in AttachedVolumes)
194194
{
195195
volume.SetParent(this);
196196
}

src/corelib/Compute/v2_1/ServerVolumeReference.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public class ServerVolumeReference : IHaveExtraData, IChildResource
2222

2323
object IServiceResource.Owner { get; set; }
2424

25-
internal void SetParent(ServerReference parent)
25+
/// <summary />
26+
protected internal void SetParent(ServerReference parent)
2627
{
2728
ServerRef = parent;
2829
}

0 commit comments

Comments
 (0)