Use generic Enum.IsDefined for typed source enum values

Proprietary

Replace resolved Enum.IsDefined(typeof(T), value) with IsDefined<T>(value) only for a nonnullable value attributed to the identical closed source enum owned by the current project and all effective targets .NET5+. Preserve the value expression, padding and call identity. Keep boxed, numeric, string, nullable and open values, unknown owners/imports, comments, deferred contexts and snapshots unchanged.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.UseGenericEnumIsDefinedForSourceEnums
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net5.UseGenericEnumIsDefinedForSourceEnums

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.