Use Task.Run for one-shot delegate APM wrappers

Proprietary

Replace Task.Factory.FromAsync(d.BeginInvoke, d.EndInvoke, null) for a fresh, parameterless void delegate local used only by that wrapper. Delegate APM is unsupported on .NET Core. This opt-in migration adopts Task.Run scheduling and child-task behavior; it is not included in version composites. UI dispatchers, custom factories, state/options, reassigned/escaped delegates and conditional files are left unchanged.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseTaskRunForDelegateFromAsync
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseTaskRunForDelegateFromAsync

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