|
@@ -263,8 +263,8 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
examExtobj.period = obj.GetProperty("period");
|
|
|
examExtobj.grades = obj.GetProperty("grades");
|
|
|
examExtobj.subjects = obj.GetProperty("subjects");
|
|
|
- examExtobj.classes = obj.GetProperty("classes");
|
|
|
- examExtobj.stuLists = obj.GetProperty("stuLists");
|
|
|
+ examExtobj.classes = (obj.TryGetProperty("classes", out JsonElement classes)) ? classes.ToObject<List<string>>() : new List<string>();
|
|
|
+ examExtobj.stuLists = (obj.TryGetProperty("stuLists", out JsonElement stuLists)) ? stuLists.ToObject<List<string>>() : new List<string>();
|
|
|
examExtobj.finishClasses = (examClassFinDic.ContainsKey(examId)) ? examClassFinDic[examId] : new List<string>();
|
|
|
examExtobj.papers = obj.GetProperty("papers");
|
|
|
//examExtobj = obj.ToObject<object>();
|
|
@@ -552,8 +552,8 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
examExtobj.period = obj.GetProperty("period");
|
|
|
examExtobj.grades = obj.GetProperty("grades");
|
|
|
examExtobj.subjects = obj.GetProperty("subjects");
|
|
|
- examExtobj.classes = obj.GetProperty("classes");
|
|
|
- examExtobj.stuLists = obj.GetProperty("stuLists");
|
|
|
+ examExtobj.classes = (obj.TryGetProperty("classes", out JsonElement classes)) ? classes.ToObject<List<string>>() : new List<string>();
|
|
|
+ examExtobj.stuLists = (obj.TryGetProperty("stuLists", out JsonElement stuLists)) ? stuLists.ToObject<List<string>>() : new List<string>();
|
|
|
examExtobj.finishClasses = (examClassFinDic.ContainsKey(examId)) ? examClassFinDic[examId] : new List<string>();
|
|
|
examExtobj.papers = obj.GetProperty("papers");
|
|
|
//examExtobj = obj.ToObject<object>();
|