public IHttpActionResult GetTask(int id) { var wordsuite = _service.GetByID(id); var pdfDocument = _generator.GetTaskInPdf(wordsuite); return(new FileActionResult(pdfDocument)); }
public WordSuiteEditModel GetByID(int id) { if (id <= 0) { throw new ArgumentNullException("id", "ID can't be negative or 0"); } return(wordSuiteMapper.MapForEdit(wordSuiteService.GetByID(id))); }
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); }