21 lines
No EOL
775 B
C#
21 lines
No EOL
775 B
C#
using IdentityShroud.Core;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
using Microsoft.Extensions.Logging.Abstractions;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace IdentityShroud.Migrations;
|
|
|
|
public sealed class DesignTimeDbFactory : IDesignTimeDbContextFactory<Db>
|
|
{
|
|
public Db CreateDbContext(string[] args)
|
|
{
|
|
// You can load from env/args/user-secrets if you like; keep placeholders out of source control.
|
|
var cfg = Options.Create(new DbConfiguration
|
|
{
|
|
ConnectionString = "Host=localhost;Port=5432;Database=identityshroud;Username=identityshroud;Password=enshrouded;SSL Mode=allow;Trust Server Certificate=true",
|
|
LogSensitiveData = false
|
|
});
|
|
|
|
return new Db(cfg, NullLoggerFactory.Instance);
|
|
}
|
|
} |