示例#1
0
        public static async Task <ScenariosModel> GetAsync(RepoInfo repo)
        {
            var mapModel = await MapModel.GetAsync(repo);

            var answer = new ScenariosModel();

            foreach (var scenario in mapModel.Scenarios)
            {
                answer.Scenarios.Add(new ScenarioModel(scenario, mapModel, repo, null));
            }

            return(answer);
        }
        public static async Task <ScenarioModel> GetAsync(RepoInfo repo, string id)
        {
            var scenariosModel = await ScenariosModel.GetAsync(repo);

            foreach (var s in scenariosModel.Scenarios)
            {
                var answer = s.FindScenario(id);
                if (answer != null)
                {
                    return(answer);
                }
            }

            return(null);
        }