Beispiel #1
0
        static void Main(string[] args)
        {
            RentalContext       ctx         = new RentalContext();
            RentRepository      rentRepo    = new RentRepository(ctx);
            VideoGameRepository gameRepo    = new VideoGameRepository(ctx);
            PersonRepository    personRepo  = new PersonRepository(ctx);
            RentLogic           rentLogic   = new RentLogic(rentRepo);
            VideoGameLogic      gameLogic   = new VideoGameLogic(gameRepo);
            PersonLogic         personLogic = new PersonLogic(personRepo);

            Console.WriteLine(">List all rents");
            rentLogic.GetAllRentals().ToList().ForEach(x => Console.WriteLine(x.AllData));

            Console.WriteLine("\n\n##################################################\n");

            Console.WriteLine("\n\n>List all games");
            gameLogic.GetAllGames().ToList().ForEach(x => Console.WriteLine(x.AllData));

            Console.WriteLine("\n\n##################################################\n");

            Console.WriteLine("\n\n>List all people");
            personLogic.GetAllPeople().ToList().ForEach(x => Console.WriteLine(x.AllData));

            //##################################################


            Console.WriteLine(rentLogic.MostFine());
            Console.WriteLine(rentLogic.MostRentedGame());
            Console.WriteLine(rentLogic.MostRentsByPerson());
        }
        public void Setup()
        {
            RentalContext       ctx        = new RentalContext();
            RentRepository      rentRepo   = new RentRepository(ctx);
            VideoGameRepository gameRepo   = new VideoGameRepository(ctx);
            PersonRepository    personRepo = new PersonRepository(ctx);

            rentLogic   = new RentLogic(rentRepo);
            gameLogic   = new VideoGameLogic(gameRepo);
            personLogic = new PersonLogic(personRepo);
        }
 public HomeController(RentLogic rentLogic, VideoGameLogic gameLogic, PersonLogic personLogic)
 {
     this.rentLogic   = rentLogic;
     this.gameLogic   = gameLogic;
     this.personLogic = personLogic;
 }