Esempio n. 1
0
        public IActionResult Index()
        {
            List <Quiz> quizes = _quiz.GetAllQuizes().ToList();

            ViewBag.quizes = quizes;

            return(View(quizes));
        }
Esempio n. 2
0
        public IActionResult MyProfile()
        {
            List <Quiz> wszystkieQuizy = new List <Quiz>();

            wszystkieQuizy = _quiz.GetAllQuizes().ToList();

            List <Quiz> quizyUzytkownika = new List <Quiz>();

            for (int i = 0; i < wszystkieQuizy.Count; i++)
            {
                if (wszystkieQuizy[i].UsernameFK == DataStorage.CurrentlyLoggedInUsername)
                {
                    quizyUzytkownika.Add(wszystkieQuizy[i]);
                }
            }

            User exampleUser = new User();

            exampleUser        = _user.GetUser(DataStorage.CurrentlyLoggedInUsername);
            exampleUser.Quizes = quizyUzytkownika;

            return(View(exampleUser));
        }