this was what you gave me as coursecontroller: public class CourseController : Controller
{
    private readonly YourDbContext _db;

    // Inject the DbContext through constructor
    public CourseController(YourDbContext db)
    {
        _db = db;
    }

    public async Task<IActionResult> Index()
    {
        // Retrieve all courses from the database asynchronously
        var courses = await _db.Courses.ToListAsync();

        return View(courses);
    }

    public async Task<IActionResult> Details(int id)
    {
        // Retrieve the course with the specified ID from the database asynchronously
        var course = await _db.Courses.FindAsync(id);

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

        return View(course);
    }

    public IActionResult Create()
    {
        return View();
    }

    [HttpPost]
    public async Task<IActionResult> Create(Course course)
    {
        if (ModelState.IsValid)
        {
            // Save the new course to the database asynchronously
            _db.Courses.Add(course);
            await _db.SaveChangesAsync();

            return RedirectToAction(nameof(Index));
        }

        return View(course);
    }

    public async Task<IActionResult> Edit(int id)
    {
        // Retrieve the course with the specified ID from the database asynchronously
        var course = await _db.Courses.FindAsync(id);

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

        return View(course);
    }

    [HttpPost]
    public async Task<IActionResult> Edit(int id, Course course)
    {
        if (id != course.CourseID)
        {
            return NotFound();
        }

        if (ModelState.IsValid)
        {
            try
            {
                // Update the course in the database asynchronously
                _db.Courses.Update(course);
                await _db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CourseExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return RedirectToAction(nameof(Index));
        }

        return View(course);
    }

    public async Task<IActionResult> Delete(int id)
    {
        // Retrieve the course with the specified ID from the database asynchronously
        var course = await _db.Courses.FindAsync(id);

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

        return View(course);
    }

    [HttpPost, ActionName(“Delete”)]
    public async Task<IActionResult> DeleteConfirmed(int id)
    {
        // Delete the course with the specified ID from the database asynchronously
        var course = await _db.Courses.FindAsync(id);
        _db.Courses.Remove(course);
        await _db.SaveChangesAsync();

        return RedirectToAction(nameof(Index));
    }

    private bool CourseExists(int id)
    {
        // Check if a course with the specified ID exists in the database
        return _db.Courses.Any(c => c.CourseID == id);
    }
} but in my coursecontroller it is  public async Task<IActionResult> Index( )
        {
            IEnumerable<Course> courses = await _courseRepository.GetAll( ); 
    
            return View(courses);
        } why is that?