Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. using Microsoft.AspNet.Identity;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. using uQuiz.Domain;
  8. using uQuiz.Domain.Abstract;
  9.  
  10. namespace uQuiz.WebUI.Controllers
  11. {
  12. [Authorize]
  13. public class DashboardController : Controller
  14. {
  15. private QuizEntities Context;
  16.  
  17. public DashboardController(QuizEntities context)
  18. {
  19. this.Context = context;
  20. }
  21.  
  22. /// <summary>
  23. /// The quiz dashboard
  24. /// </summary>
  25. /// <returns></returns>
  26. public ActionResult Index()
  27. {
  28. // Get the logged in user ID
  29. int userId = Convert.ToInt32(User.Identity.GetUserId());
  30.  
  31. IEnumerable<Quiz> usersQuizzes = this.Context.Quizzes.Where(x => x.UserId == userId && x.Deleted == false).OrderBy(d => d..CreatedTime).ToList();
  32.  
  33. return View();
  34. }
  35. }
  36. }
  37.  
  38. IEnumerable<Quiz> usersQuizzes = this.Context.Quizzes.Where(x => x.UserId == userId && x.Deleted == false).ToList();
  39.  
  40. IEnumerable<Quiz> usersQuizzes = this.Context.Quizzes.Where(x => x.UserId == userId && x.Deleted == false).OrderBy(d => d..CreatedTime).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement