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()) }); }
public static Mistake MapMistake(MistakeDTO mistake) { return(new Mistake() { Id = mistake.Id, UserId = mistake.UserId, WordId = mistake.WordId, Language = mistake.Language.ToString() }); }
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(); }