public async Task <IActionResult> Create(CreateLectionViewModel input) { if (this.ModelState.IsValid) { var user = await this.userManager.GetUserAsync(this.User); var userId = user.Id; await this.lectionsService.CreateAsync(input.Title, input.Description, input.CourseId, input.Url, userId); } this.StatusMessage = "Lection created!"; return(this.Redirect("/Administration/Lections")); }
public IActionResult Create() { var users = this.userManager.Users; IEnumerable <CoursesDropDownMenuViewModel> courses = this.coursesService.GetAll <CoursesDropDownMenuViewModel>(); var viewModel = new CreateLectionViewModel { Courses = courses, Users = users, }; return(this.View(viewModel)); }