visual studio auto format code code example
Example 1: format in visual studio code
Ctrl+K Ctrl+F
Example 2: how to auto format c# code in visual studio
format a selection: Ctrl+K, Ctrl+F
format a document: Ctrl+K, Ctrl+D
Ctrl+K Ctrl+F
format a selection: Ctrl+K, Ctrl+F
format a document: Ctrl+K, Ctrl+D