Example #1
0
 public Server(int port)
 {
     TcpListener               = new TcpListener(IPAddress.Loopback, port);
     ClientsDictionary         = new Dictionary <string, TcpClient>();
     Running                   = false;
     BFormatter                = new BinaryFormatter();
     loginService              = DiContainer.GetContainer().LoginService;
     rezervareService          = DiContainer.GetContainer().RezervareService;
     excursiiManagementService = DiContainer.GetContainer().ExcursiiManagementService;
 }
Example #2
0
 private DiContainer()
 {
     Connection                = Utils.CreateConnection();
     AgentieRepo               = new AgentieRepository(Connection);
     ExcursieRepo              = new ExcursieRepository(Connection);
     RezervareRepo             = new RezervareRepository(Connection, AgentieRepo, ExcursieRepo);
     LoginService              = new LoginService(AgentieRepo);
     ExcursiiManagementService = new ExcursiiManagementService(ExcursieRepo);
     RezervareService          = new RezervareService(ExcursiiManagementService, RezervareRepo);
 }