-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add a common definition for sub-resource #20524
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
/// <summary> | ||
/// A class representing a sub-resource that contains only the ID. | ||
/// </summary> | ||
[ReferenceType] | ||
public abstract class SubResource | ||
{ | ||
/// <summary> | ||
/// ARM resource identifier. | ||
/// </summary> | ||
/// <value></value> | ||
public virtual ResourceIdentifier Id { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be get only with a protected constructor that takes in the id and sets it. This is for deserialization scenarios There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put a todo in this file for us to consider how to make |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
namespace Azure.ResourceManager.Core | ||
{ | ||
/// <summary> | ||
/// A class representing a sub-resource that contains only the read-only ID. | ||
/// </summary> | ||
[ReferenceType] | ||
public abstract class SubResourceReadOnly | ||
{ | ||
/// <summary> | ||
/// ARM resource identifier (read-only). | ||
/// </summary> | ||
/// <value></value> | ||
public virtual ResourceIdentifier Id { get; } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing corresponding SubResource.Serialization.cs file to serialize / deserialize this class