Entity Framework Core

Add NuGet package

dotnet add package Microsoft.EntityFrameworkCore.SqlServer

Create context:

public class ApplicationDbContext : DbContext
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options)
    {
    }
}

Add to ConfigureServices:

var connection = @"Server=.;Database=test;User=sa;Password=P@55w0rd;";
            services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(connection));

results matching ""

    No results matching ""