public ScenarioGetModel Get(int id) { Scenario scenario = scenarioRepository.GetById(id); return(new ScenarioGetModel { id = scenario.ID, scenarioName = scenario.Name, scenarioDesc = scenario.Description, userId = scenario.UserID, completed = scenarioServices.isCompleted(id), percentDone = scenarioServices.CalculateCompletion(id) }); }
public ActionResult <DocumentationPaths> Get(string id) { if (string.IsNullOrWhiteSpace(id)) { throw new ArgumentException("null or whitespace", nameof(id)); } var scenario = _scenarioRepository.GetById(id); if (scenario == null) { return(NotFound()); } return(Ok(new DocumentationPaths(scenario.FrontendSourcePath, scenario.BackendSourcePath, scenario.TapioDocumentationUrl))); }