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

Use property reference type #37542

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -29,7 +29,7 @@
<Compile Include="$(AutoRestSharedCodeDirectory)ChangeTrackingDictionary.cs" LinkBase="Shared\AutoRest" />
<Compile Include="$(AutoRestSharedCodeDirectory)ChangeTrackingList.cs" LinkBase="Shared\AutoRest" />
<Compile Include="$(AzureCoreSharedSources)Argument.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)TypeReferenceTypeAttribute.cs" LinkBase="Shared\Core" />
<Compile Include="$(AzureCoreSharedSources)PropertyReferenceTypeAttribute.cs" LinkBase="Shared\Core" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Azure.Core.Expressions.DataFactory
{
/// <summary> Azure Key Vault secret reference. </summary>
[TypeReferenceType(false, new[]{ nameof(SecretBaseType)})]
[PropertyReferenceType(new string[0], new[]{ nameof(SecretBaseType)})]
public partial class DataFactoryKeyVaultSecretReference : DataFactorySecretBaseDefinition
{
/// <summary> Initializes a new instance of AzureKeyVaultSecretReference. </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Azure.Core.Expressions.DataFactory
{
/// <summary> Linked service reference type. </summary>
[TypeReferenceType]
[PropertyReferenceType]
public partial class DataFactoryLinkedServiceReference
{
/// <summary> Initializes a new instance of DataFactoryLinkedServiceReference. </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Azure.Core.Expressions.DataFactory
/// Please note <see cref="DataFactorySecretBaseDefinition"/> is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
/// The available derived classes include <see cref="DataFactorySecretString"/> and <see cref="DataFactoryKeyVaultSecretReference"/>.
/// </summary>
[TypeReferenceType(false, new[]{ nameof(SecretBaseType)})]
[PropertyReferenceType(new string[0], new[]{ nameof(SecretBaseType)})]
public abstract partial class DataFactorySecretBaseDefinition
{
/// <summary> Initializes a new instance of DataFactorySecretBaseDefinition. </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Azure.Core.Expressions.DataFactory
{
/// <summary> Azure Data Factory secure string definition. The string value will be masked with asterisks '*' during Get or List API calls. </summary>
[TypeReferenceType(false, new[]{ nameof(SecretBaseType)})]
[PropertyReferenceType(new string[0], new[]{ nameof(SecretBaseType)})]
public partial class DataFactorySecretString : DataFactorySecretBaseDefinition
{
/// <summary> Initializes a new instance of DataFactorySecretString. </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,32 @@ namespace Azure.Core
internal class PropertyReferenceTypeAttribute : Attribute
{
/// <summary>
/// Instatiate a new reference type attribute.
/// Instantiate a new reference type attribute.
/// </summary>
/// <param name="optionalProperties"> An array of property names that are optional when comparing the type. </param>
public PropertyReferenceTypeAttribute(string[] optionalProperties)
: this(optionalProperties, Array.Empty<string>())
{
}

/// <summary>
/// Instantiate a new reference type attribute.
/// </summary>
/// <param name="optionalProperties"> An array of property names that are optional when comparing the type. </param>
/// <param name="internalPropertiesToInclude"></param>
JoshLove-msft marked this conversation as resolved.
Show resolved Hide resolved
public PropertyReferenceTypeAttribute(string[] optionalProperties, string[] internalPropertiesToInclude)
{
OptionalProperties = optionalProperties;
InternalPropertiesToInclude = internalPropertiesToInclude;
}

public string[] InternalPropertiesToInclude { get; }

/// <summary>
/// Instantiate a new reference type attribute.
/// </summary>
public PropertyReferenceTypeAttribute()
: this(Array.Empty<string>())
: this(Array.Empty<string>(), Array.Empty<string>())
{
}

Expand Down