public IActionResult Index() { List <Quiz> quizes = _quiz.GetAllQuizes().ToList(); ViewBag.quizes = quizes; return(View(quizes)); }
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)); }