21 lines
651 B
C#
21 lines
651 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace DBConnection.Contexts;
|
|
|
|
/// <summary>
|
|
/// Pulls connection string from 'PostgresSql' and selected with provider 'PostgresSql'
|
|
/// </summary>
|
|
public class PostgresSqlAppDbContext : AppDbContext
|
|
{
|
|
public PostgresSqlAppDbContext(DbContextOptions options, IConfiguration configuration) : base(options, configuration)
|
|
{
|
|
}
|
|
|
|
protected override string ConnectionStringName => "PostgresSql";
|
|
|
|
protected override void UseSqlConnection(DbContextOptionsBuilder builder, string connectionString)
|
|
{
|
|
builder.UseNpgsql(connectionString);
|
|
}
|
|
} |