Example #1
0
 public static MistakeViewModel MapMistake(MistakeDTO mistake)
 {
     return(new MistakeViewModel()
     {
         Id = mistake.Id,
         UserId = mistake.UserId,
         WordId = mistake.WordId,
         Language = (Delegates.Language)Enum.Parse(typeof(Delegates.Language), mistake.Language.ToString())
     });
 }
Example #2
0
 public static Mistake MapMistake(MistakeDTO mistake)
 {
     return(new Mistake()
     {
         Id = mistake.Id,
         UserId = mistake.UserId,
         WordId = mistake.WordId,
         Language = mistake.Language.ToString()
     });
 }
Example #3
0
 public void SaveMistakenWords(IEnumerable <AnswerDTO> pruposedAnswers)
 {
     foreach (var wrongWord in pruposedAnswers.Where(a => !a.IsCorrect))
     {
         MistakeDTO mistake = new MistakeDTO()
         {
             UserId   = Database.Words.Get(wrongWord.Id).Topic.UserId,
             WordId   = wrongWord.Id,
             Language = wrongWord.Language
         };
         Database.Mistakes.Create(Mapper.MapMistake(mistake));
     }
     Database.Save();
 }