EnvironmentModule 1.0.1
EnvironmentModule
appsettings.json dosyasındaki veya herhengi bir config dosyasındaki environmnetleri içe aktarır. İçe aktarılmış değerler Docker compose dosyasında belirtilmiş ise bu değerleri varsayılan oalrak ekler.
Projeye Ekleme
Windows : %appdata%\NuGet\NuGet.Config Lİnux Veya Mac : ~/.nuget/NuGet/NuGet.Config
...
<packageSources>
...
<add key="localnuget.roboliza.com" value="http://172.16.33.42:5011/v3/index.json" protocolVersion="3" allowInsecureConnections="true" />
<add key="nuget.roboliza.com" value="https://nuget.roboliza.com/v3/index.json" protocolVersion="3" allowInsecureConnections="true" />
</packageSources>
DockerFile Dosyasına Ekleme
RUN dotnet nuget add source http://172.16.33.42:5011/v3/index.json
RUN dotnet nuget add source https://nuget.roboliza.com/v3/index.json
Kullanım
appsettings.json
{
"DefaultEnvironments": [
{
"Key": "MYSQL_SERVER",
"Value": "localhost"
},
{
"Key": "MYSQL_PORT",
"Value": "3307"
},
...
]
}
Program.cs
var appSettingsEnvironments = builder.Configuration.GetSection("DefaultEnvironments");
builder.Services.AddEnvironmentModule(appSettingsEnvironments);
No packages depend on EnvironmentModule.
.NET 6.0
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.1 | 537 | 01/13/2025 |