0
0
RhSolutions-Api/RhSolutions.Api/ConnectionStringsUtil.cs

31 lines
972 B
C#
Raw Normal View History

2024-02-07 16:32:34 +03:00
public class ConnectionStringsUtil
{
private string dbHost;
private string dbPort;
private string dbName;
private string dbUser;
private string dbPassword;
private IConfiguration _configuration;
public ConnectionStringsUtil(IConfiguration configuration)
{
_configuration = configuration;
dbHost = configuration["DB_HOST"] ?? "localhost";
dbPort = configuration["DB_PORT"] ?? "5000";
dbName = configuration["DB_DATABASE"] ?? "rhsolutions";
dbUser = configuration["DB_USER"] ?? "chebser";
dbPassword = configuration["DB_PASSWORD"] ?? "Rehau-987";
}
public string GetRhDbString()
{
return _configuration["ConnectionsStrings:RhSolutionsLocal"]
?? $"Host={dbHost};Port={dbPort};Database={dbName};Username={dbUser};Password={dbPassword}";
}
public string GetIdentityDbString()
{
return _configuration["ConnectionsStrings:RhSolutionsLocal"]
2024-02-07 16:48:35 +03:00
?? $"Host={dbHost};Port={dbPort};Database={dbName};Username={dbUser};Password={dbPassword}";
2024-02-07 16:32:34 +03:00
}
}