diff --git a/Directory.Build.props b/Directory.Build.props index 52332b7..41e8f40 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,7 +9,7 @@ Choice generator ALTA Software llc. Copyright © 2024 ALTA Software llc. - 1.2.3 + 1.3.0 diff --git a/src/AltaSoft.Choice.Generator/Executor.cs b/src/AltaSoft.Choice.Generator/Executor.cs index d284c9a..4ec1948 100644 --- a/src/AltaSoft.Choice.Generator/Executor.cs +++ b/src/AltaSoft.Choice.Generator/Executor.cs @@ -115,6 +115,8 @@ private static SourceCodeBuilder Process(INamedTypeSymbol typeSymbol, List +/// Represents the attribute used to mark a property as a choice property. +/// +[AttributeUsage(AttributeTargets.Property)] +public sealed class ChoicePropertyAttribute : Attribute; diff --git a/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldGenerateAllMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs b/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldGenerateAllMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs index e4118cb..758cb24 100644 --- a/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldGenerateAllMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs +++ b/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldGenerateAllMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs @@ -49,6 +49,7 @@ public Authorisation1Choice() /// [DisallowNull] [XmlElement("Code")] + [ChoiceProperty] public partial TestNamespace.OtherNamespace.Authorisation1Code? Code { get => _code; @@ -67,6 +68,7 @@ public partial TestNamespace.OtherNamespace.Authorisation1Code? Code /// [DisallowNull] [XmlElement("Proprietary")] + [ChoiceProperty] public partial string? Proprietary { get => _proprietary; diff --git a/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldNotGenerateImplicitMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs b/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldNotGenerateImplicitMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs index 0d1bcac..a943f9a 100644 --- a/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldNotGenerateImplicitMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs +++ b/tests/AltaSoft.Choice.Generator.SnapshotTests/Snapshots/ChoiceGeneratorTest.ChoiceTypeShouldNotGenerateImplicitMethodsAndCompileCorrectly#Authorisation1Choice.g.verified.cs @@ -49,6 +49,7 @@ public Authorisation1Choice() /// [DisallowNull] [XmlElement("Code")] + [ChoiceProperty] public partial string? Code { get => _code; @@ -67,6 +68,7 @@ public partial string? Code /// [DisallowNull] [XmlElement("Proprietary")] + [ChoiceProperty] public partial TestNamespace.OtherNamespace.Authorisation1Code? Proprietary { get => _proprietary;