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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Product>Choice generator</Product>
<Company>ALTA Software llc.</Company>
<Copyright>Copyright © 2024 ALTA Software llc.</Copyright>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions src/AltaSoft.Choice.Generator/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private static SourceCodeBuilder Process(INamedTypeSymbol typeSymbol, List<IProp
sb.AppendSummary("<para>Choice enum </para>");
sb.AppendLine("[JsonIgnore]");
sb.AppendLine("[XmlIgnore]");
sb.AppendLine("[ChoiceTypeProperty]");
sb.AppendLine("public ChoiceOf ChoiceType { get; private set; }");
sb.NewLine();

Expand Down
10 changes: 10 additions & 0 deletions src/AltaSoft.Choice/ChoiceTypePropertyAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace AltaSoft.Choice
{
/// <summary>
/// Represents the attribute used to mark a property as a choice type property.
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class ChoiceTypePropertyAttribute : Attribute;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public Authorisation1Choice()
/// </summary>
[JsonIgnore]
[XmlIgnore]
[ChoiceTypeProperty]
public ChoiceOf ChoiceType { get; private set; }

private TestNamespace.OtherNamespace.Authorisation1Code? _code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public Authorisation1Choice()
/// </summary>
[JsonIgnore]
[XmlIgnore]
[ChoiceTypeProperty]
public ChoiceOf ChoiceType { get; private set; }

private string? _code;
Expand Down
Loading