Skip to content

Instantly share code, notes, and snippets.

@munirwanis
Created June 11, 2015 17:59
Show Gist options
  • Save munirwanis/4b23eedc74751edfe21d to your computer and use it in GitHub Desktop.
Save munirwanis/4b23eedc74751edfe21d to your computer and use it in GitHub Desktop.
Menu em console application
#region Menu
public static void Menu(AuthenticateRequestDTO authRequest, AuthenticateResponseDTO authResponse)
{
var readKey = Console.ReadKey(false).GetHashCode() - 48; // -48 porque está em hashcode, e 1 em hash é 49, por exemplo.
Console.WriteLine("---- Main Menu ----\n");
switch (readKey)
{
case 1:
authResponse = AuthenticatePost(authRequest);
break;
default:
Console.WriteLine("Not valid!\n");
break;
}
}
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment