mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds initial ASP.NET Core MVC replacement for Blazor WASM
This commit is contained in:
1 parent
5409200c7a
commit
193861c9c5
56 files changed
+505
-4139
No files matched your search
+6
-19
@@ -1,6 +1,5 @@
|
||||
using Lumina.Presentation.Web.Common.Models.Configuration;
|
||||
using Lumina.Presentation.Web.Common.Models.Configuration;
|
||||
using Lumina.Presentation.Web.Common.Utilities;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -12,30 +11,18 @@ namespace Lumina.Presentation.Web.Common.DependencyInjection;
|
||||
internal static class PresentationWebLayerConfiguration
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Extension method for adding the Lumina.Presentation.Web configuration to the <see cref="WebAssemblyHostBuilder"/>.
|
||||
/// </summary>
|
||||
/// <param name="builder">The <see cref="WebAssemblyHostBuilder"/> to add the configuration to.</param>
|
||||
/// <returns>The updated <see cref="WebAssemblyHostBuilder"/>.</returns>
|
||||
public static WebAssemblyHostBuilder AddConfiguration(this WebAssemblyHostBuilder builder)
|
||||
{
|
||||
// add the configuration sources to the configuration builder
|
||||
builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
|
||||
builder.Configuration.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true);
|
||||
|
||||
builder.Services.BindConfiguration(builder.Configuration);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension method for registering the configuration options of the Lumina.Presentation.Web project into the Dependency Injection container.
|
||||
/// </summary>
|
||||
/// <param name="serviceCollection">The <see cref="IServiceCollection"/> to bind the configuration options to.</param>
|
||||
/// <param name="configuration">The configuration to be bound.</param>
|
||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||
internal static IServiceCollection BindConfiguration(this IServiceCollection serviceCollection, IConfiguration configuration)
|
||||
internal static IServiceCollection BindConfiguration(this IServiceCollection serviceCollection, IConfigurationManager configuration)
|
||||
{
|
||||
// add the configuration sources to the configuration builder
|
||||
configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
|
||||
configuration.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true);
|
||||
|
||||
serviceCollection.AddOptions<ServerConfigurationModel>()
|
||||
.Bind(configuration.GetRequiredSection(ServerConfigurationModel.SECTION_NAME))
|
||||
.ValidateFluently()
|
||||
|
||||
Reference in new issue
Block a user