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

Add default constructors to resource classes #20583

Merged
merged 1 commit into from
Apr 22, 2021
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 @@ -12,6 +12,11 @@ namespace Azure.ResourceManager.Core
public abstract class Resource<TIdentifier> : IEquatable<Resource<TIdentifier>>, IEquatable<string>,
IComparable<Resource<TIdentifier>>, IComparable<string> where TIdentifier : TenantResourceIdentifier
{
/// <summary>
/// Initializes an empty instance of <see cref="Resource{TIdentifier}"/>.
/// </summary>
protected Resource() { }

/// <summary>
/// Initializes a new instance of <see cref="Resource{TIdentifier}"/> for deserialization.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ namespace Azure.ResourceManager.Core
[ReferenceType]
public partial class SubResource
{
/// <summary>
/// Initializes an empty instance of <see cref="SubResource"/>.
/// </summary>
protected internal SubResource() { }

/// <summary> Initializes a new instance of SubResource. </summary>
/// <param name="id"> ARM resource Id. </param>
protected internal SubResource(string id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ namespace Azure.ResourceManager.Core
[ReferenceType(typeof(TenantResourceIdentifier))]
public abstract partial class TrackedResource<TIdentifier> : Resource<TIdentifier> where TIdentifier : TenantResourceIdentifier
{
/// <summary>
/// Initializes an empty instance of <see cref="TrackedResource{TIdentifier}"/>.
/// </summary>
protected TrackedResource() { }

/// <summary>
/// Initializes a new instance of the <see cref="TrackedResource{TIdentifier}"/> class for deserialization.
/// </summary>
Expand All @@ -21,7 +26,7 @@ public abstract partial class TrackedResource<TIdentifier> : Resource<TIdentifie
/// <param name="tags"> The tags for the resource. </param>
/// <param name="location"> The location of the resource. </param>
protected TrackedResource(TIdentifier id, string name, ResourceType type, IDictionary<string, string> tags, LocationData location)
:base(id, name, type)
: base(id, name, type)
{
Tags = tags ?? new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
Location = location;
Expand Down