public void Dispose() { WebStoreRepository.Dispose(); WebStoreItemRepository.Dispose(); WebStoresChangeLogRepository.Dispose(); CourseRepository.Dispose(); CourseChangeLogRepository.Dispose(); }
// Get: Course Details public ActionResult CourseDetails(int?id) { CourseRepository courseRepository = new CourseRepository(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var course = courseRepository.GetById(id); if (course == null) { return(HttpNotFound()); } courseRepository.Dispose(); return(View(course)); }