-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (23 loc) · 802 Bytes
/
Program.cs
File metadata and controls
27 lines (23 loc) · 802 Bytes
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
using System;
using CommandLine;
using ConsoleTables;
using CsharpTaskManagement.Cli;
using CsharpTaskManagement.Models;
using CsharpTaskManagement.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace CsharpTaskManagement
{
internal class Program
{
private static readonly string _jsonFilePath = "tasks.json";
public static void Main(string[] args)
{
var services = new ServiceCollection()
.AddTransient<ITaskRepository>(provider => new JsonFileTaskRepository(_jsonFilePath))
.BuildServiceProvider();
ITaskRepository taskRepository = services.GetService<ITaskRepository>()!;
var cli = new CsharpTaskManagementCli(taskRepository);
cli.Start(args);
}
}
}