Skip to content

Commit 565d947

Browse files
committed
Merge branch 'releases/6.4.x' into releases/6.x.x
2 parents f61bb31 + 70a32fa commit 565d947

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

samples/Thinktecture.Runtime.Extensions.Samples/SmartEnums/ProductGroup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace Thinktecture.SmartEnums;
22

3-
[EnumGeneration(ComparisonOperators = OperatorsGeneration.DefaultWithKeyTypeOverloads)]
3+
[EnumGeneration(ComparisonOperators = OperatorsGeneration.DefaultWithKeyTypeOverloads,
4+
SkipToString = true)]
45
public sealed partial class ProductGroup : IValidatableEnum<int>
56
{
67
public static readonly ProductGroup Apple = new(1, "Apple", ProductCategory.Fruits);
@@ -30,4 +31,9 @@ private static ProductGroup CreateInvalidItem(int key)
3031
// the key must not be null
3132
return new(key, false, "Unknown product group", ProductCategory.Get("Unknown"));
3233
}
34+
35+
public override string ToString()
36+
{
37+
return DisplayName;
38+
}
3339
}

0 commit comments

Comments
 (0)