Esempio n. 1
0
        public async Task <IActionResult> GetAllScenariosAsync()
        {
            var response = new ListModelResponse <ScenarioViewModel>();

            try
            {
                var scenariosDataModel = await _scenarioRepository.GetAllScenarios();

                response.Model = scenariosDataModel.Select(item => item.ToViewModel());

                response.Message = String.Format("Total of records: {0}", response.Model.Count());


                ///return response.ToHttpResponse();
            }
            catch (Exception ex)
            {
                response.DidError     = true;
                response.ErrorMessage = ex.Message;
            }

            return(response.ToHttpResponse());
        }
 public IEnumerable <Models.Scenario> Get()
 {
     return(_scenarioRepository.GetAllScenarios().AsEnumerable());
 }