public IHttpActionResult RemoveWordProgress(WordProgressModel wordProgress) { if (wordProgress == null) { throw new ArgumentNullException("wordProgress", "WordProgress can't be null"); } return(wordProgressService.RemoveByStudent(wordProgressMapper.Map(wordProgress)) ? Ok() as IHttpActionResult : BadRequest() as IHttpActionResult); }
public TrainingWordSuiteModel GetWordSuiteWithAllWords(int id) { var wordSuite = _trainingMapper.Map(_service.GetByID(id)); foreach (WordTranslationModel word in wordSuite.WordTranslations) { if (_progressService.IsStudentWord(_progressMapper.Map(wordSuite.Id, word.Id))) { word.IsStudentWord = true; } else { word.IsStudentWord = false; } } return(wordSuite); }