Skip to content

Commit

Permalink
Add default constructors to resource classes (#20583)
Browse files Browse the repository at this point in the history
  • Loading branch information
isra-fel authored Apr 22, 2021
1 parent d632fc6 commit 054d552
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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

0 comments on commit 054d552

Please sign in to comment.