protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); _categoryRepository.Dispose(); _coursesRepository.Dispose(); _selectedCategoryRepository.Dispose(); _subCoursesRepository.Dispose(); } base.Dispose(disposing); }