mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 03:56:30 +00:00
Code cleanup (#1026)
* Resolve warnings and move shared props to Directory.Build.props and Directory.Packages.props * Cleanup more messages * Fix more messages * Fix build issues
This commit is contained in:
@@ -5,18 +5,8 @@ public static class WebApplicationBuilderExtensions
|
||||
public static WebApplicationBuilder WithConfiguration(this WebApplicationBuilder builder)
|
||||
{
|
||||
var config = BuildInfo.Configuration;
|
||||
var appSettingsStream = GetManifestResourceStream($"Daybreak.API.Configuration.appsettings.json");
|
||||
if (appSettingsStream is null)
|
||||
{
|
||||
throw new InvalidOperationException("Failed to load appsettings.json");
|
||||
}
|
||||
|
||||
var appSettingsConfigStream = GetManifestResourceStream($"Daybreak.API.Configuration.appsettings.{config}.json");
|
||||
if (appSettingsConfigStream is null)
|
||||
{
|
||||
throw new InvalidOperationException($"Failed to load appsettings.{config}.json");
|
||||
}
|
||||
|
||||
var appSettingsStream = GetManifestResourceStream($"Daybreak.API.Configuration.appsettings.json") ?? throw new InvalidOperationException("Failed to load appsettings.json");
|
||||
var appSettingsConfigStream = GetManifestResourceStream($"Daybreak.API.Configuration.appsettings.{config}.json") ?? throw new InvalidOperationException($"Failed to load appsettings.{config}.json");
|
||||
builder.Configuration
|
||||
.AddJsonStream(appSettingsStream)
|
||||
.AddJsonStream(appSettingsConfigStream)
|
||||
|
||||
Reference in New Issue
Block a user