Convert static Main entry point to top-level statements
ProprietaryConverts a class Program { static Main(...) { ... } } entry point to C# 9 top-level statements: the body of Main is lifted to the file level and the Program class and any enclosing namespace are removed. Scoped to the unambiguous single-type/single-Main case.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net5. ConvertMainToTopLevelStatementsmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net5. ConvertMainToTopLevelStatementsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.