more soft
This commit is contained in:
@ -77,17 +77,31 @@ namespace Yavsc.Models
|
|||||||
et.FindProperty("DateCreated").IsReadOnlyAfterSave = true;
|
et.FindProperty("DateCreated").IsReadOnlyAfterSave = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is not a failback procedure.
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
var appSetup = (string)AppDomain.CurrentDomain.GetData(Constants.YavscConnectionStringEnvName);
|
if (optionsBuilder.IsConfigured) return;
|
||||||
if (appSetup!=null) optionsBuilder.UseNpgsql(appSetup);
|
if (!string.IsNullOrWhiteSpace(Startup.ConnectionString))
|
||||||
else {
|
{
|
||||||
var envSetup = Environment.GetEnvironmentVariable(Constants.YavscConnectionStringEnvName);
|
optionsBuilder.UseNpgsql(Startup.ConnectionString);
|
||||||
if (envSetup!=null) optionsBuilder.UseNpgsql(envSetup);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var appSetup = (string) AppDomain.CurrentDomain.GetData(Constants.YavscConnectionStringEnvName);
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(appSetup))
|
||||||
|
{
|
||||||
|
optionsBuilder.UseNpgsql(appSetup);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var envSetup = Environment.GetEnvironmentVariable(Constants.YavscConnectionStringEnvName);
|
||||||
|
if (envSetup!=null)
|
||||||
|
optionsBuilder.UseNpgsql(envSetup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DbSet<Client> Applications { get; set; }
|
public DbSet<Client> Applications { get; set; }
|
||||||
|
|
||||||
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
public DbSet<RefreshToken> RefreshTokens { get; set; }
|
||||||
|
Reference in New Issue
Block a user