VOOZH about

URL: https://www.nuget.org/packages/Aguacongas.DynamicConfiguration.WebApi/

⇱ NuGet Gallery | Aguacongas.DynamicConfiguration.WebApi 3.1.0




Aguacongas.DynamicConfiguration.WebApi 3.1.0

dotnet add package Aguacongas.DynamicConfiguration.WebApi --version 3.1.0
 
 
NuGet\Install-Package Aguacongas.DynamicConfiguration.WebApi -Version 3.1.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aguacongas.DynamicConfiguration.WebApi" Version="3.1.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aguacongas.DynamicConfiguration.WebApi" Version="3.1.0" />
 
Directory.Packages.props
<PackageReference Include="Aguacongas.DynamicConfiguration.WebApi" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aguacongas.DynamicConfiguration.WebApi --version 3.1.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Aguacongas.DynamicConfiguration.WebApi, 3.1.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aguacongas.DynamicConfiguration.WebApi@3.1.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aguacongas.DynamicConfiguration.WebApi&version=3.1.0
 
Install as a Cake Addin
#tool nuget:?package=Aguacongas.DynamicConfiguration.WebApi&version=3.1.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Aguacongas.DynamicConfiguration.WebApi

Library to add configuration Web API to an ASP.NET 6 web site.

Setup

Program.cs

using Aguacongas.DynamicConfiguration.Redis;
using Yarp.Configuration.Model;
using Swashbuckle.AspNetCore.SwaggerUI;
using Aguacongas.DynamicConfiguration.WebApi.Controllers;

var builder = WebApplication.CreateBuilder(args);

var configuration = builder.Configuration;
// Add Redis configuration provider.
configuration.AddRedis(options => configuration.GetSection(nameof(RedisConfigurationOptions)).Bind(options));

var services = builder.Services;
// Add services to the container.
services.Configure<ReverseProxyOptions>(configuration.GetSection(nameof(ReverseProxyOptions)))
 .AddAuthorization(options =>
 {
 // The web api requires 2 policies, DYNAMIC_CONFIGURATION_READER_POLICY and DYNAMIC_CONFIGURATION_WRITTER_POLICY
 // In this sample those policies requires nothing, all users have access to the api.
 // You should update this code to meet your requirement.
 options.AddPolicy(ConfigurationController.DYNAMIC_CONFIGURATION_READER_POLICY, 
 builder => builder.RequireAssertion(context => true));
 options.AddPolicy(ConfigurationController.DYNAMIC_CONFIGURATION_WRITTER_POLICY, 
 builder => builder.RequireAssertion(context => true));
 });

services.AddAuthentication(); // this sample doesn't have authentication system but shoudl add yours.

services.AddControllersWithViews()
 .AddConfigurationWebAPI(builder.Configuration, options => options.Provider = ((IConfigurationRoot)configuration).Providers.First(p => p is RedisConfigurationProvider));
 
services.AddRazorPages();

services.AddSwaggerGenFromConfiguration(configuration);

var app = builder.Build();

// Auto reload the configuration when changes occur.
app.SubscribeToConfigurationChanges();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
 app.UseWebAssemblyDebugging();
}
else
{
 app.UseExceptionHandler("/Error");
 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
 app.UseHsts();
}

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
 app.UseSwagger()
 .UseSwaggerUI(c =>
 {
 configuration.GetSection(nameof(SwaggerUIOptions)).Bind(c);
 });
}

app.UseHttpsRedirection()
 .UseBlazorFrameworkFiles()
 .UseStaticFiles()
 .UseAuthentication()
 .UseAuthorization();

app.MapRazorPages();
app.MapControllers();
app.MapFallbackToFile("index.html");

app.Run();

appsetting.json

{
 "AllowedHosts": "*",
 "RedisConfigurationOptions": {
 "ConnectionString": "localhost",
 "HashKey": "Aguacongas.DynamicConfiguration.AdminApi",
 "Channel": "Aguacongas.DynamicConfiguration.AdminApi.Channel"
 },
 "OpenApiInfo": {
 "Title": "DynamicConfiguration Admin API",
 "Description": "API used to manage YARP.",
 "Version": "v1",
 "Contact": {
 "Name": "Olivier Lefebvre",
 "Email": "olivier.lefebvre@live.com",
 "Url": "https://github.com/aguacongas"
 }
 }
}

Gets a configuration

Sets a configuration

Product Versions Compatible and additional computed target framework versions.
.NET net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aguacongas.DynamicConfiguration.WebApi:

Package Downloads
Aguacongas.TheIdServer

OpenID/Connect , OAuth and WS-Federation server base on Duende IdentityServer.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Aguacongas.DynamicConfiguration.WebApi:

Repository Stars
Aguafrommars/TheIdServer
OpenID/Connect, OAuth2, WS-Federation and SAML 2.0 server based on Duende IdentityServer and ITFoxtec Identity SAML 2.0 with its admin UI
Version Downloads Last Updated
3.1.0 2,688 11/21/2025
3.0.1 438 11/21/2025
3.0.0 523 11/13/2025
2.0.0 8,712 11/24/2023
2.0.0-preview2- 304 11/13/2025
2.0.0-preview1-0080 1,026 10/4/2023
1.0.1 5,194 2/2/2023
1.0.1-preview1-0044 355 2/2/2023
1.0.0 9,026 12/25/2021
1.0.0-preview1-0057 404 12/23/2021