Esempio n. 1
0
 public UserStatisticViewModel(int userId, bool onlyLastResult)
 {
     _resultQuizContext = new ResultQuizContext();
     var lastResultLoaded = _resultQuizContext.Load(_resultQuizContext.GetLastQuizResultsForUserQuery(userId));
     _userContext = new UserContext();
     var result = _userContext.Load(_userContext.GetUserByIdQuery(userId));
     result.Completed += new EventHandler(result_Completed);
     lastResultLoaded.Completed += new EventHandler(lastResultLoaded_Completed);
 }
Esempio n. 2
0
 public UserStatisticViewModel(int userId)
 {
     _resultQuizContext = new ResultQuizContext();
     var quizResult = _resultQuizContext.Load(_resultQuizContext.GetAllQuizResultsForUserQuery(userId));
     quizResult.Completed += new EventHandler(quizResult_Completed);
     _userContext = new UserContext();
     var result = _userContext.Load(_userContext.GetUserByIdQuery(userId));
     result.Completed += new EventHandler(result_Completed);
 }