Example #1
0
        public IActionResult Index()
        {
            ViewBag.Dojos  = dojoFactory.FindAll();
            ViewBag.Ninjas = ninjaFactory.FindAll();
            var ninjas = ninjaFactory.FindAll();

            return(View());
        }
Example #2
0
        public IActionResult Index()
        {
            IEnumerable <Ninja> Ninjas = ninjaFactory.FindAll();

            foreach (var item in Ninjas)
            {
                System.Console.WriteLine(item.dojo_id);
                //This is a slow way. How to map one to many???
                if (item.dojo_id > 0)
                {
                    item.Dojo = dojoFactory.FindByID(item.dojo_id);
                }
            }
            ViewBag.Ninjas = Ninjas;
            ViewBag.Dojos  = dojoFactory.FindAll();

            return(View());
        }
 public IActionResult AllDojos()
 {
     ViewBag.allDojos  = dojoFactory.FindAll();
     ViewBag.allNinjas = ninjaFactory.FindAll();
     return(View());
 }
Example #4
0
 public IActionResult Ninja()
 {
     ViewBag.dojos_list = dojoFactory.FindAll();
     ViewBag.ninjas     = ninjaFactory.FindAll();
     return(View());
 }
Example #5
0
 public IActionResult NinjaIndex()
 {
     ViewBag.ninjas = ninjaFactory.FindAll();
     return(View("Ninja"));
 }