Blog.Tools.ApplicationSetup.Program.Main C# (CSharp) Method

Main() static private method

static private Main ( string args ) : void
args string
return void
		static void Main(string[] args)
		{
			_localIpAddress = ConfigurationManager.AppSettings.Get("BlogServer");

			if (args == null || args.Length == 0)
			{
				InitializeApp();
				AddConsoleMessage("Successfully initialized app with an admin user");
			}
			else
			{
				var tArgs = args.ToList();

				if (tArgs.Contains("--drop"))
				{
					Rollback();
				}
				else if (tArgs.Contains("--seed"))
				{
					AsyncContext.Run(() => SeedData());
				}
				else if (tArgs.Contains("--help"))
				{
					ShowHelp();
				}
				else if (tArgs.Count > 1)
				{
					AddConsoleMessage("Invalid number or usage of arguments");
					ShowHelp();
				}
				else
				{
					AddConsoleMessage("Invalid number or usage of arguments");
					ShowHelp();
				}
			}
		}