public ReviewInfo(InternalReview review) { ReviewID = review.ID; LanguageID = review.LanguageID; DateStarted = review.DateStarted; ReviewCards = review.ReviewCards.ToList() .Select(card => new ReviewCardInfo(card)) .OrderByDescending(card => card.InternalLossCount) .ToList(); }
public void StartReview() { var memories = unit.UserFlashcardMemoryRepository.GetFirstTrainableMemories(sessionService.UserID, sessionService.LanguageID, 30); var review = new InternalReview() { DateStarted = DateTime.Now, LanguageID = sessionService.LanguageID, UserID = sessionService.UserID, }; foreach (var memory in memories) { review.ReviewCards.Add(new ReviewCard() { FlashcardID = memory.FlashcardID, InternallLossCount = 0 }); } unit.InternalReviewRepository.Add(review); unit.SaveChanges(); sessionService.UserInfo.ReviewInfo = new Session.Models.ReviewInfo(review); }