Skip to content

Commit 806c8c0

Browse files
committed
Add configuration utility class
1 parent 6522ca7 commit 806c8c0

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

Configuration.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using SimpleInventoryManagementSystem.Controller;
2+
using SimpleInventoryManagementSystem.DAO;
3+
using SimpleInventoryManagementSystem.Interfaces;
4+
using SimpleInventoryManagementSystem.Repository;
5+
6+
namespace SimpleInventoryManagementSystem;
7+
8+
public static class Configuration
9+
{
10+
public static IUserController BuildUserController()
11+
{
12+
return new UserController(new ProductRepository(new MemoryProductDao()));
13+
}
14+
}

Program.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
// See https://aka.ms/new-console-template for more information
1+
using SimpleInventoryManagementSystem;
22

3-
using SimpleInventoryManagementSystem.Controller;
4-
using SimpleInventoryManagementSystem.DAO;
5-
using SimpleInventoryManagementSystem.Repository;
6-
7-
var controller = new UserController(new ProductRepository(new MemoryProductDao()));
3+
var controller = Configuration.BuildUserController();
84

95
while (true)
106
{

0 commit comments

Comments
 (0)