private LessonPlan.LessonPlan LoadLessonPlan() { LessonPlan.LessonPlan lessonPlan = new LessonPlan.LessonPlan(); string lessonPlanPath = HttpContext.Current.Server.MapPath("~/LessonPlan/lesson_plan.json"); using (StreamReader reader = new StreamReader(lessonPlanPath)) { string lessonPlanJson = reader.ReadToEnd(); lessonPlan = JsonConvert.DeserializeObject <LessonPlan.LessonPlan>(lessonPlanJson); } return(lessonPlan); }
private LessonPlan.LessonPlan LoadLessonPlan() { string lessonPlanAPI = ConfigurationManager.AppSettings["LessonServiceAPI"]; LessonPlan.LessonPlan lessonPlan = new LessonPlan.LessonPlan(); List <BotCourseModel> lessons = LessonPlanHelper.GetLessonPlanAsync <List <BotCourseModel> >(lessonPlanAPI).Result; foreach (BotCourseModel lesson in lessons) { lessonPlan.Lessons.Add(new Lesson() { LessonTitle = lesson.Name, currentTopic = lesson.AssignmentId, APIUrl = lesson.APIUrl }); } return(lessonPlan); }
protected override void Load(ContainerBuilder builder) { base.Load(builder); LessonPlan = LoadLessonPlan(); }