is it possible to create something like an extension for Visual Studio 2019 that adds custom scaffolding razor pages to an ASP.Net project? I want to create some templates which can be used on several projects with different class types. Is it possible to create a window like the one for adding Identity? (see below)
I found the source code of the Identity templates on Github but unfortunately I do not know how to include new templates in VS 2019 that I can pick it from the context menue.

Please check the section "Changing the Scaffolding" in the following link: https://learn.microsoft.com/en-us/archive/msdn-magazine/2018/march/asp-net-use-razor-to-generate-html-for-templates-in-a-single-page-app
This allow you to edit the default scaffolding templates used by Visual Studio.
Make sure that the folder you create in the project root is named "CodeTemplates". If you only want to edit scaffolding for the views you only need to copy MvcView folder to the new folder created in your project. By there you can edit the view templates for your project.
I also recommend you to install T4Editor extension in Visual Studio.