private void VerifyFlashCards(Collection newCollection, IEnumerable <FlashCardCollection> flashcards)
        {
            foreach (var fc in flashcards)
            {
                var flashCard = _flashCardRepository.Obter(fcp => fcp.Question == fc.FlashCard.Question, i => i.Samples).SingleOrDefault();
                if (flashCard == null)
                {
                    flashCard = new FlashCard
                    {
                        Question = fc.FlashCard.Question,
                        Answer   = fc.FlashCard.Answer,
                        Status   = fc.FlashCard.Status,
                        Samples  = fc.FlashCard.Samples
                    };
                }
                else
                {
                    /*
                     * foreach (var sample in fc.FlashCard.Samples)
                     * {
                     *  flashCard.Samples.Add(sample);
                     * }*/
                }

                newCollection.AddFlashCard(flashCard, fc.Occurrences);
            }
        }
示例#2
0
 private void CreateFlashCards(Collection collection, IEnumerable <Word> words)
 {
     foreach (var w in words)
     {
         w.Text = w.Text.ToLower();
         collection.AddFlashCard(new FlashCard()
         {
             Question = w.Text,
             Status   = StatusFlashCard.New
         }, w.Phrases.Count());
     }
 }