visual studio 2019 don't close code on console code example
Example: how to stop window from terminating c# visual studio
Console.ReadLine(); //add this to the end of the program and the terminal will not close until another key is entered
Console.ReadLine(); //add this to the end of the program and the terminal will not close until another key is entered