ENtity framework core to get data from a table mvc database first code example
Example: asp.net core entity framework database first
PM> Scaffold-DbContext "Server=.\SQLExpress;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models