Skip to content
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 @@ -11,5 +11,25 @@ namespace Azure.ResourceManager.Core
[AttributeUsage(AttributeTargets.Class)]
public class ReferenceTypeAttribute : Attribute
{
/// <summary>
/// Instatiate a new reference type attribute.
/// </summary>
/// <param name="genericType"> The generic type for this reference type. </param>
public ReferenceTypeAttribute(Type genericType)
{
GenericType = genericType;
}

/// <summary>
/// Instatiate a new reference type attribute.
/// </summary>
public ReferenceTypeAttribute() : this(null)
{
}

/// <summary>
/// Get the generic type for this reference type.
/// </summary>
public Type GenericType { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.Core
/// <summary>
/// A class representing the base resource used by all azure resources.
/// </summary>
[ReferenceType]
[ReferenceType(typeof(TenantResourceIdentifier))]
public abstract class Resource<TIdentifier> : IEquatable<Resource<TIdentifier>>, IEquatable<string>,
IComparable<Resource<TIdentifier>>, IComparable<string> where TIdentifier : TenantResourceIdentifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Azure.ResourceManager.Core
/// <summary>
/// Generic representation of a tracked resource. All tracked resources should extend this class
/// </summary>
[ReferenceType]
[ReferenceType(typeof(TenantResourceIdentifier))]
public abstract partial class TrackedResource<TIdentifier> : Resource<TIdentifier> where TIdentifier : TenantResourceIdentifier
{
private IDictionary<string, string> _tag = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
Expand Down