Replace Enum.ToString() with nameof
ProprietaryReplace MyEnum.Value.ToString() with nameof(MyEnum.Value). The nameof operator is evaluated at compile time, avoiding runtime reflection.
OpenRewrite. Recipes. CSharp. CodeQuality. Performance. ReplaceEnumToStringWithNameofmod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Performance. ReplaceEnumToStringWithNameofInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.