When I want to use the method:
public async Task<IActionResult> Index()
{
return View(await _context.Students.ToListAsync());
}
The ToListAsync
method does not come out and gives me an error.
When I want to use the method:
public async Task<IActionResult> Index()
{
return View(await _context.Students.ToListAsync());
}
The ToListAsync
method does not come out and gives me an error.
The extensor method you are looking for is in the class EntityFrameworkQueryableExtensions
that belongs to namespace
Microsoft.EntityFrameworkCore
so you have to add the using:
using Microsoft.EntityFrameworkCore;