public IActionResult Index() { List <SelectListItem> chordsList = new List <SelectListItem>(); SelectListItem chord; ChordDataList list = new ChordDataList(); var data = new List <KeyValuePair <string, string> >(list.GetData()); foreach (KeyValuePair <string, string> kvp in data) { chord = new SelectListItem { Text = kvp.Value, Value = kvp.Key }; chordsList.Add(chord); } ViewBag.ChordList = chordsList; return(View()); }
/// <summary> /// Get a list of chords needed for the select chord drop down list /// </summary> /// <returns></returns> public List <KeyValuePair <string, string> > GetListOfChords() { var data = new ChordDataList(); return(data.GetData()); }