-
Notifications
You must be signed in to change notification settings - Fork 146
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (45 loc) · 1.61 KB
/
Copy pathProgram.cs
File metadata and controls
47 lines (45 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2016 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
// Licensed under MIT licence. See License.txt in the project root for license information.
using System;
namespace MyFirstEfCoreApp
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(
"Commands: l (list), u (change url), r (resetDb) and e (exit) - add -l to first two for logs");
Console.Write(
"Checking if database exists... ");
Console.WriteLine(Commands.WipeCreateSeed(true) ? "created database and seeded it." : "it exists.");
do
{
Console.Write("> ");
var command = Console.ReadLine();
switch (command)
{
case "l":
Commands.ListAll();
break;
case "u":
Commands.ChangeWebUrl();
break;
case "l -l":
Commands.ListAllWithLogs();
break;
case "u -l":
Commands.ChangeWebUrlWithLogs();
break;
case "r":
Commands.WipeCreateSeed(false);
break;
case "e":
return;
default:
Console.WriteLine("Unknown command.");
break;
}
} while (true);
}
}
}