I want to read rows from a database with EF Core

0

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.

    
asked by Cristopher Cedeño Rivas 10.01.2018 в 05:43
source

1 answer

1

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;
    
answered by 10.01.2018 / 13:56
source