public void MissionListBox_Click(object sender, EventArgs e) { if (missionsListBox.SelectedItem != null) { string str = missionsListBox.SelectedValue.ToString(); missionRepo.GetAllMissions().ForEach(m => { if (m.MissionName == str) { ShowInfo(m.Id); } }); } }
public List <Mission> GetAllMissionsByPlanet(int planetId) { List <Mission> missions = new List <Mission>(); _missionRepository.GetAllMissions().ForEach(m => { if (m.PlanetId == planetId) { missions.Add(m); } }); return(missions); }