Exemplo n.º 1
0
        public async Task <IActionResult> GetInfoFormResearchModule(int idSoftware)
        {
            Result <InfoFormResearchModuleData> result = await _researchModuleGateway.GetInfoFormResearchModule();

            List <string> nameFileOnDiggos = await GetNameFileOsintOnDiggos(Convert.ToString(idSoftware));

            IEnumerable <ResearchModuleData> ieResearchModuleInstalled = await _researchModuleGateway.GetResearchModuleBySoftwareId(idSoftware);

            if (ieResearchModuleInstalled != null)
            {
                List <ResearchModuleData> researchModuleInstall = ieResearchModuleInstalled.ToList <ResearchModuleData>();
                for (int i = 0; i < nameFileOnDiggos.Count; i++)
                {
                    string nameFile = nameFileOnDiggos[i];
                    foreach (ResearchModuleData researchModule in researchModuleInstall)
                    {
                        if (nameFile == researchModule.Name)
                        {
                            nameFileOnDiggos.RemoveAt(i);
                            break;
                        }
                    }
                }
            }

            result.Content.NameFileOsintAvaibles = nameFileOnDiggos;

            return(Ok(result.Content));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetAllSoftwareAndResearch()
        {
            IEnumerable <SoftwareData> _ieSoftwares = await _softwareGateway.GetAllSoftware();

            if (_ieSoftwares == null)
            {
                return(BadRequest("Software not found"));
            }

            List <SoftwareData>            _softwares            = _ieSoftwares.AsList();
            List <SoftwareAndResearchData> _softwaresAndResearch = new List <SoftwareAndResearchData>();

            for (int i = 0; i < _softwares.Count; i++)
            {
                IEnumerable <ResearchModuleData> researchModules = await _researchModuleGateway.GetResearchModuleBySoftwareId(_softwares[i].Id);

                _softwaresAndResearch.Add(new SoftwareAndResearchData(_softwares[i], researchModules.AsList()));
            }

            return(Ok(_softwaresAndResearch));
        }