protected override async Task <IEnumerable <Simulation> > LoadModelAsync(string snapshotFile) { var snapshots = await _snapshotTask.LoadSnapshots <PKSim.Core.Snapshots.Simulation>(snapshotFile); var tasks = snapshots.Select(x => _simulationMapper.MapToModel(x, _projectRetriever.Current)); return(await Task.WhenAll(tasks)); }
protected override async Task <IEnumerable <Simulation> > LoadModelAsync(LoadFromSnapshotDTO loadFromSnapshotDTO) { var snapshots = await _snapshotTask.LoadSnapshotsAsync <PKSim.Core.Snapshots.Simulation>(loadFromSnapshotDTO.SnapshotFile); var simulationContext = new SimulationContext(run: loadFromSnapshotDTO.RunSimulations, new SnapshotContext(project: _projectRetriever.Current, version: ProjectVersions.Current)); var tasks = snapshots.Select(x => _simulationMapper.MapToModel(x, simulationContext)); return(await Task.WhenAll(tasks)); }