예제 #1
0
        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)
            });
        }
예제 #2
0
        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)));
        }