-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
executable file
·34 lines (29 loc) · 956 Bytes
/
Program.cs
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
namespace Money_CLI;
using Serilog;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.IO;
using Money_CLI.CommandLine;
using Money_CLI.Controllers;
using Money_CLI.Models.Enums;
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static async Task<int> Main(params string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();
// First, set the SystemVariables, in case it does not exist.
SystemVariables.EnsureCreated();
// Then, ensure that there is a database to work with.
using (AppDbContext context = new AppDbContext()) {
context.Database.EnsureCreated();
}
return await Commands.Root.InvokeAsync(args);
}
}