public async Task <IActionResult> Summary() { // Get info from database. List <FuzzerRunEntity> runEntities = await _endpointRepository.GetAllFuzzerRuns(); // Convert database entities to view models. List <FuzzerRunViewModel> runViewModels = new List <FuzzerRunViewModel>(); foreach (FuzzerRunEntity entity in runEntities) { runViewModels.Add(new FuzzerRunViewModel(entity)); } // Render view. return(View(runViewModels)); }
private async Task <List <FuzzerRunViewModel> > GetRunSummaries() { List <FuzzerRunViewModel> runModels = new List <FuzzerRunViewModel>(); List <FuzzerRunEntity> runEntities = await _endpointRepository.GetAllFuzzerRuns(); foreach (FuzzerRunEntity runEntity in runEntities) { List <FuzzerGenerationEntity> generationEntities = await _endpointRepository.GetFuzzerGenerationByRun(runEntity.id.Value); FuzzerRunViewModel runModel = new FuzzerRunViewModel(runEntity); foreach (FuzzerGenerationEntity generationEntity in generationEntities) { runModel.Generations.Add(new FuzzerGenerationViewModel(generationEntity)); } runModels.Add(runModel); } return(runModels); }