-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
25 lines (23 loc) · 900 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Npgsql.efcore.pg.issue1576repro.Data;
namespace Npgsql.efcore.pg.issue1576repro
{
class Program
{
public static IConfiguration Configuration { get; } = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables("ASPNETCORE_")
.Build();
static void Main(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<AppDbContext>();
optionsBuilder.UseNpgsql(Configuration.GetConnectionString("AppDbContext"));
var context = new AppDbContext(optionsBuilder.Options);
context.Database.Migrate();
}
}
}