flatten configuration file structure
This commit is contained in:
parent
9ccd0bb68d
commit
41158b34c5
@ -2,7 +2,7 @@ namespace cuqmbr.TravelGuide.Application;
|
||||
|
||||
public sealed class ConfigurationOptions
|
||||
{
|
||||
public static string SectionName { get; } = "Application";
|
||||
public static string SectionName { get; } = "";
|
||||
|
||||
public LocalizationConfigurationOptions Localization { get; set; } = new();
|
||||
|
||||
|
@ -25,17 +25,14 @@ public static class Configuration
|
||||
.AddCommandLine(args)
|
||||
.Build();
|
||||
|
||||
services.AddOptions<PersistenceConfigurationOptions>().Bind(
|
||||
configuration.GetSection(
|
||||
PersistenceConfigurationOptions.SectionName));
|
||||
services.AddOptions<PersistenceConfigurationOptions>()
|
||||
.Bind(configuration);
|
||||
|
||||
services.AddOptions<ApplicationConfigurationOptions>().Bind(
|
||||
configuration.GetSection(
|
||||
ApplicationConfigurationOptions.SectionName));
|
||||
services.AddOptions<ApplicationConfigurationOptions>()
|
||||
.Bind(configuration);
|
||||
|
||||
services.AddOptions<InfrastructureConfigurationOptions>().Bind(
|
||||
configuration.GetSection(
|
||||
InfrastructureConfigurationOptions.SectionName));
|
||||
services.AddOptions<InfrastructureConfigurationOptions>()
|
||||
.Bind(configuration);
|
||||
|
||||
return services;
|
||||
}
|
||||
|
@ -21,7 +21,10 @@ public static class Configuration
|
||||
ExchangeApiCurrencyConverterService>()
|
||||
.AddScoped<
|
||||
cuqmbr.TravelGuide.Application.Common.Services.LiqPayPaymentService,
|
||||
cuqmbr.TravelGuide.Infrastructure.Services.LiqPayPaymentService>();
|
||||
cuqmbr.TravelGuide.Infrastructure.Services.LiqPayPaymentService>()
|
||||
.AddScoped<
|
||||
EmailSenderService,
|
||||
MailKitEmailSenderService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
@ -1,15 +1,10 @@
|
||||
{
|
||||
"Application": {
|
||||
"Logging": {
|
||||
"Type": "SimpleConsole",
|
||||
"LogLevel": "Information",
|
||||
"TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffK",
|
||||
"UseUtcTimestamp": true
|
||||
},
|
||||
"Datastore": {
|
||||
"Type": "postgresql",
|
||||
"ConnectionString": "Host=127.0.0.1:5432;Database=travel_guide;Username=postgres;Password=0000;Include Error Detail=true"
|
||||
},
|
||||
"Localization": {
|
||||
"DefaultCultureName": "en-US",
|
||||
"CacheDuration": "00:30:00"
|
||||
@ -21,7 +16,10 @@
|
||||
"AccessTokenValidity": "24:00:00",
|
||||
"RefreshTokenValidity": "72:00:00"
|
||||
},
|
||||
"Infrastructure": {
|
||||
"Datastore": {
|
||||
"Type": "postgresql",
|
||||
"ConnectionString": "Host=127.0.0.1:5432;Database=travel_guide;Username=postgres;Password=0000;Include Error Detail=true"
|
||||
},
|
||||
"PaymentProcessing": {
|
||||
"CallbackAddressBase": "https://api.travel-guide.cuqmbr.xyz",
|
||||
"ResultAddressBase": "https://travel-guide.cuqmbr.xyz",
|
||||
@ -30,6 +28,4 @@
|
||||
"PrivateKey": "sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,10 @@
|
||||
{
|
||||
"Application": {
|
||||
"Logging": {
|
||||
"Type": "SimpleConsole",
|
||||
"LogLevel": "Information",
|
||||
"TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffK",
|
||||
"UseUtcTimestamp": true
|
||||
},
|
||||
"Datastore": {
|
||||
"Type": "postgresql",
|
||||
"ConnectionString": "Host=127.0.0.1:5432;Database=travel_guide;Username=postgres;Password=0000;Include Error Detail=true"
|
||||
},
|
||||
"Localization": {
|
||||
"DefaultCultureName": "en-US",
|
||||
"CacheDuration": "00:30:00"
|
||||
@ -21,7 +16,10 @@
|
||||
"AccessTokenValidity": "24:00:00",
|
||||
"RefreshTokenValidity": "72:00:00"
|
||||
},
|
||||
"Infrastructure": {
|
||||
"Datastore": {
|
||||
"Type": "postgresql",
|
||||
"ConnectionString": "Host=127.0.0.1:5432;Database=travel_guide;Username=postgres;Password=0000;Include Error Detail=true"
|
||||
},
|
||||
"PaymentProcessing": {
|
||||
"CallbackAddressBase": "https://api.travel-guide.cuqmbr.xyz",
|
||||
"ResultAddressBase": "https://travel-guide.cuqmbr.xyz",
|
||||
@ -30,6 +28,4 @@
|
||||
"PrivateKey": "sandbox_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ namespace cuqmbr.TravelGuide.Infrastructure;
|
||||
|
||||
public sealed class ConfigurationOptions
|
||||
{
|
||||
public static string SectionName { get; } = "Application:Infrastructure";
|
||||
public static string SectionName { get; } = "";
|
||||
|
||||
public PaymentProcessingConfigurationOptions PaymentProcessing { get; set; }
|
||||
public PaymentProcessingConfigurationOptions PaymentProcessing { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class PaymentProcessingConfigurationOptions
|
||||
@ -13,7 +13,7 @@ public sealed class PaymentProcessingConfigurationOptions
|
||||
|
||||
public string ResultAddressBase { get; set; }
|
||||
|
||||
public LiqPayConfigurationOptions LiqPay { get; set; }
|
||||
public LiqPayConfigurationOptions LiqPay { get; set; } = new();
|
||||
}
|
||||
|
||||
public sealed class LiqPayConfigurationOptions
|
||||
|
@ -2,7 +2,7 @@ namespace cuqmbr.TravelGuide.Persistence;
|
||||
|
||||
public sealed class ConfigurationOptions
|
||||
{
|
||||
public static string SectionName { get; } = "Application:Datastore";
|
||||
public static string SectionName { get; } = "Datastore";
|
||||
|
||||
public string Type { get; set; } = "inmemory";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user