-
-
Save fernandolopes/e0be9d1fbe89224c01607dd759b45a50 to your computer and use it in GitHub Desktop.
appsettings.Development.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class InjectorData | |
| { | |
| public static void RegisterServices(IConfiguration Configuration, IServiceCollection services) | |
| { | |
| //Database | |
| string conn = Configuration.GetConnectionString("SQLDatabase"); | |
| var username = Environment.GetEnvironmentVariable("username"); | |
| var password = Environment.GetEnvironmentVariable("password"); | |
| var host = Environment.GetEnvironmentVariable("HOST"); | |
| conn = $"Host={host};User ID={username};Password={password};{conn}"; | |
| if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(host)) | |
| { | |
| throw new ArgumentNullException("conn"); | |
| } | |
| . | |
| . | |
| . | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "ConnectionStrings": { | |
| "SQLDatabase": "Port=5432;Database=Nome-do-banco;Persist Security Info=False;TrustServerCertificate=False;" | |
| }, | |
| "Logging": { | |
| "Debug": { | |
| "LogLevel": { | |
| "Default": "Trace" | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment