private async Task ClearCourse(StepikApiCourse course) { foreach (var sectionId in course.SectionsIds) { await client.DeleteSection(sectionId).ConfigureAwait(false); } }
private async Task <StepikApiLesson> CreateLessonAndSectionForSlide(Slide slide, StepikApiCourse stepikCourse, int sectionIndex) { var lesson = await client.UploadLesson(new StepikApiLesson { Title = slide.Title, }).ConfigureAwait(false); var section = await client.UploadSection(new StepikApiSection { CourseId = stepikCourse.Id.Value, Position = sectionIndex, Title = slide.Title, }); await client.UploadUnit(new StepikApiUnit { SectionId = section.Id.Value, LessonId = lesson.Id.Value, Position = 1, }); return(lesson); }