private void CreateNewCourse() { var instructorRepo = new InstructorRepository(); var instructor = instructorRepo.GetById(2); var course = new Course(); course.Title = "English"; course.Credits = 5; course.InstructorId = instructor.Id; //course.Instructor = instructor; course.Enrollments = new List<Enrollment>() { new Enrollment() { StudentId = 7, Grade = 80 } }; var courseRepo = new CourseRepository(); courseRepo.InsertOrUpdate(course); }
private void GetInstructor() { var instructorRepo = new InstructorRepository(); var instructor = instructorRepo.GetById(2); }