I received a suggestion via twitter https://twitter.com/KarenPayneMVP/status/1600988000565227525?s=20&t=UkVIwuCmD7c0smdlVGvOFw that we should add an option to control if top-level statements are used in the generated project. It makes sense to me. I would assume that most aspnet framework developers would prefer to not use top-level statements by default, but they should be able to toggle that.
@abpiskunov @danroth27