Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
strauss_d_getting_started_with_visual_studio_2022_learning_a.pdf
Скачиваний:
123
Добавлен:
26.06.2023
Размер:
17.04 Mб
Скачать

Chapter 1 Getting to Know Visual Studio 2022

in sync with the new folder structure. To do this, place your cursor on the namespace name and hold down Ctrl+. to bring up the Quick Actions and Refactoring menu. Select the option to change the namespace to your folder name.

Paste JSON As Classes

If you work with JSON often, the following feature is another gem. If you have copied some JSON and need an object to serialize and deserialize the JSON into (using Newtonsoft, for example), you can select Edit from the Visual Studio menu, and select the Paste Special option. From there, you will see an option to Paste JSON as Classes. You can do the same for XML. This will quickly generate the correct class structure to represent the JSON copied by yourself. This is a fantastic time saver.

Enable Code Cleanup on Save

Another great feature in Visual Studio 2022 is the ability to perform a code cleanup on save. From the Tools menu, select Options Text Editor Code Cleanup

as seen in Figure 1-45.

Figure 1-45.  Code cleanup on save

46