model.SubjectTerms = model.SelectedSubjectTerm.Trim(',').Split(',').ToList().Select(x => new SubjectTerm { SubjectTermId = int.Parse(x) }).ToList();
其中 SelectedSubjectTerm 是保存ID 用逗号隔开的字符串
使用split分割 然后再封装成SubjectTerm 实体
if (null != model.SubjectTerms) model.SelectedSubjectTerm = "," + string.Join(",", model.SubjectTerms.Select(x => x.SubjectTermId)) + ",";
反过来合并id