Open sandboxFocus

Class EnumExtensions

Inheritance
EnumExtensions
Namespace: Metalama.Framework.Engine.Utilities
Assembly: Metalama.Framework.Sdk.dll
Syntax
public static class EnumExtensions

Methods

Name Description
ToStringSafe(Enum)

Returns a deterministic string representation of an enum value. For enums with alias members (multiple names sharing the same underlying value, e.g. Default = 0, Success = 0), the built-in ToString() picks one of the names in an implementation-defined way that can vary across .NET runtimes. This method returns the alphabetically-first preferred name among aliases — names marked [Obsolete] and the literal name Default are deprioritized and only used as a fallback when no preferred alias exists, so diagnostic messages and log output stay stable.