Use generic Enum.GetValues for explicitly cast source enums
ProprietaryReplace resolved Enum.GetValues(typeof(T)) with GetValues<T>() when an identical explicit enum-array cast surrounds the call, T is a closed source enum owned by the current project, and every target is .NET5+. Preserve the cast, attributed type and call identity. Keep external/open types, other casts, unknown owners/imports, comments, deferred contexts and conditional snapshots unchanged.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net5. UseGenericEnumGetValuesForSourceEnumsmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net5. UseGenericEnumGetValuesForSourceEnumsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.