Ejemplo n.º 1
0
        /// <summary>
        ///     从json生成课程
        /// </summary>
        public static CourseEntry FromJson(string jsonContent)
        {
            var j = JsonConvert.DeserializeObject <CourseEntryJson>(jsonContent);
            var r = new CourseEntry()
            {
                CourseName         = j.CourseName,
                EnableNotification = j.EnableNotification
            };

            foreach (var item in j.SubEntries)
            {
                r.AddSubEntry(CourseSubEntry.FromJson(item));
            }
            return(r);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 转换Json为课程
 /// </summary>
 /// <param name="json"></param>
 /// <returns></returns>
 public static CourseEntry AsCourse(this string json) => CourseEntry.FromJson(json);