Use Task.Run for ignored parameterless delegate APM calls
ProprietaryOpt-in port of ignored bound parameterless void delegate BeginInvoke(null,null) calls, using Task.Run(() => delegate.Invoke()). Require a closed one-use local initialized by construction, lambda or proven in-class method group. Retain caller-side construction and require the captured local never changes or escapes. Adopt Task scheduling, child-task and unobserved-exception behavior. Leave System.Action to its existing recipe, generic delegates, async callers, callbacks/state, observed results, escaped/reassigned delegates, UI dispatchers, lambdas/queries, discarded comments and conditional files unchanged. Separate from version composites.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net3_0. UseTaskRunForIgnoredDelegateBeginInvokemod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net3_0. UseTaskRunForIgnoredDelegateBeginInvokeInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.