Example #1
0
        // GET: Instructors/Edit/5
        public async Task <IActionResult> Edit(int?id, [FromServices] IInstructorService service)
        {
            if (!id.HasValue)
            {
                return(NotFound());
            }

            var instructor = await service.GetInstructorByIdForEditAsync(id.Value);

            if (instructor == null)
            {
                return(NotFound());
            }

            await PopulateCourseAssignedDataAsync(instructor.CoursesAssigned, service);

            return(View($"{_viewFolder}Edit.cshtml", instructor));
        }