how to create dbcontext in entity framework core database first code example
Example 1: asp.net core entity framework database first
PM> Scaffold-DbContext "Server=.\SQLExpress;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Example 2: generic dbcontext entity framework core
public class SampleContext : GuidDbContext
{
public IDbSet<Foo> Foos { get; set; }
public IDbSet<Bar> Bars { get; set; }
}