18 lines
685 B
C#
18 lines
685 B
C#
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Microsoft.EntityFrameworkCore.Design;
|
|||
|
|
|||
|
namespace Demo.Data.RemoteData.RemoteDataBase
|
|||
|
{
|
|||
|
public abstract class DesignTimeDbContextFactoryBase<TContext> : IDesignTimeDbContextFactory<TContext> where TContext : DbContext
|
|||
|
{
|
|||
|
public TContext CreateDbContext(string[] args)
|
|||
|
{
|
|||
|
var builder = new DbContextOptionsBuilder<TContext>();
|
|||
|
builder.UseNpgsql("Host=45.67.56.214;Port=5421;Database=PresenceDB;Username=user5;Password=EtEJqhsf");
|
|||
|
|
|||
|
return CreateNewInstance(builder.Options);
|
|||
|
}
|
|||
|
|
|||
|
protected abstract TContext CreateNewInstance(DbContextOptions<TContext> options);
|
|||
|
}
|
|||
|
}
|