public async Task Index()

in Webapp/SDAF/Controllers/SystemController.cs [66:87]


        public async Task<IActionResult> Index()
        {
            SapObjectIndexModel<SystemModel> systemIndex = new();

            try
            {
                List<SystemEntity> systemEntities = await _systemService.GetAllAsync();
                List<SystemModel> systems = systemEntities.FindAll(s => s.System != null).ConvertAll(s => JsonConvert.DeserializeObject<SystemModel>(s.System));
                systemIndex.SapObjects = systems;

                List<AppFile> appfiles = await _appFileService.GetAllAsync();
                systemIndex.AppFiles = appfiles.FindAll(file => !file.Id.EndsWith("INFRASTRUCTURE.tfvars") && file.Id != "VM-Images.json" && file.Id.IndexOf("_custom_") == -1);

                systemIndex.ImagesFile = await Helper.GetImagesFile(_appFileService);
            }
            catch (Exception e)
            {
                TempData["error"] = "Error retrieving existing systems: " + e.Message;
            }

            return View(systemIndex);
        }