コード例 #1
0
        public void Start()
        {
            do
            {
                Console.WriteLine("Welcome Villain! What would you like to do?");
                Console.WriteLine("[0] Create a Villain?");
                Console.WriteLine("[1] Get all Villains?");
                Console.WriteLine("[2] Create some chaos?");
                Console.WriteLine("[3] Go back to the main menu?");
                userInput = Console.ReadLine();
                switch (userInput)
                {
                case "0":
                    //call create a villain, call get villain details
                    SuperVillain newVillain = GetVillainDetails();
                    repo.AddAVillain(newVillain);
                    break;

                case "1":
                    //call get all villains
                    repo.GetAllVillains();
                    break;

                case "2":
                    //call the event delegate for villain work, call get villain by name
                    tasks.PlanWorldDomination();
                    tasks.CreateChaos();
                    break;

                case "3":
                    //call the main menu
                    MainMenu main = new MainMenu();
                    main.Start();
                    break;

                default:
                    //invalid input message;
                    service.InvalidInputMessage();
                    break;
                }
            }while(!userInput.Equals("3"));
        }
コード例 #2
0
 public List <SuperVillain> GetAllVillains()
 {
     return(repo.GetAllVillains());
 }
コード例 #3
0
        public IActionResult GetAllVillains()
        {
            var viliains = _repo.GetAllVillains();

            return(View(viliains));
        }
コード例 #4
0
        public IActionResult GetVillains()
        {
            var superVillians = _repo.GetAllVillains();

            return(View(superVillians));
        }