// GET: LessonSection/Create public async Task <ActionResult> Create(long id) { Lesson currentLesson = await _lessonRepositoryAsync.GetByIdAsync(id); if (currentLesson.Sections != null && currentLesson.Sections.Count > 0) { LessonViewModel model = new LessonViewModel { Lesson = currentLesson, Sections = currentLesson.Sections, Section = new LessonSection { User = currentLesson.User, LessonId = currentLesson.Id } }; return(View(model)); } else { LessonViewModel model = new LessonViewModel { Lesson = currentLesson, Section = new LessonSection { User = currentLesson.User, LessonId = currentLesson.Id } }; return(View(model)); } }
// GET: Lesson/Details/5 public async Task <ActionResult> Details(int id) { return(View(await _lessonRepositoryAsync.GetByIdAsync(id))); }