I've done some reading here, and here and I'm still confused about if I should use Enviorment.Exit()
in my console application.
In a method, I have the following code if the user types exit at the prompt,
if(userSelect == "exit")
{
Environment.Exit(0);
}
Update:
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Welcome to my Console App");
Console.WriteLine();
consoleManager();
}
public static void consoleManager()
{
string consolePrompt = "ConsoleApp\">";
string whichMethod = "";
Console.Write(consolePrompt);
whichMethod = Console.ReadLine();
if(whichMethod == "view enties")
{
viewEntry();
}
else
if(whichMethod == "Add Entry")
{
addEntry();
}
else
if(whichMethod == "exit")
{
//what to do here
}
else
{
help();
}
}