diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/ReferenceTypeAttribute.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/ReferenceTypeAttribute.cs index f9f07473014b6..ae434c2cf6d9b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/ReferenceTypeAttribute.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/ReferenceTypeAttribute.cs @@ -11,5 +11,25 @@ namespace Azure.ResourceManager.Core [AttributeUsage(AttributeTargets.Class)] public class ReferenceTypeAttribute : Attribute { + /// + /// Instatiate a new reference type attribute. + /// + /// The generic type for this reference type. + public ReferenceTypeAttribute(Type genericType) + { + GenericType = genericType; + } + + /// + /// Instatiate a new reference type attribute. + /// + public ReferenceTypeAttribute() : this(null) + { + } + + /// + /// Get the generic type for this reference type. + /// + public Type GenericType { get; } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs index 81faffdf95330..94a5ac72f921e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.Core /// /// A class representing the base resource used by all azure resources. /// - [ReferenceType] + [ReferenceType(typeof(TenantResourceIdentifier))] public abstract class Resource : IEquatable>, IEquatable, IComparable>, IComparable where TIdentifier : TenantResourceIdentifier { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/TrackedResource.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/TrackedResource.cs index 816446aa3921e..61c95615db4bd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/TrackedResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/TrackedResource.cs @@ -9,7 +9,7 @@ namespace Azure.ResourceManager.Core /// /// Generic representation of a tracked resource. All tracked resources should extend this class /// - [ReferenceType] + [ReferenceType(typeof(TenantResourceIdentifier))] public abstract partial class TrackedResource : Resource where TIdentifier : TenantResourceIdentifier { private IDictionary _tag = new Dictionary(StringComparer.InvariantCultureIgnoreCase);