public void Save() { CardModel model = new CardModel(); model.Name = cardName.text; model.Note = note.text; model.Frequency = int.Parse(frequency.text); model.Type = typeList.value; model.Decisions[0] = decision1.Get(); model.Decisions[1] = decision2.Get(); model.GroupId = editor.groups[groupList.value].Id; if (selected != 0) { model.Id = editor.cards[cardList.value - 1].Id; } editor.SaveCard(selected, model); }