Table of Contents

Class ConfigurationLists

Namespace
FishMMO.WebShared
Assembly
FishMMO-WebShared.dll

Reads list settings so that the configuration source that sets a list replaces it entirely.

public static class ConfigurationLists
Inheritance
ConfigurationLists
Inherited Members

Remarks

.NET configuration merges arrays index by index: a list is the keys Name:0, Name:1, ... and a later file only overrides the indices it names. Each web server's appsettings.json is the Development template and appsettings.Production.json the Production overrides, so a Production list shorter than the Development one kept the Development tail: one HTTPS connect origin over six loopback ones became the HTTPS origin plus five http://localhost origins, and the WebGL server refused to start in Production.

Here the highest-priority source that sets the list (environment variables, then the environment's file, then appsettings.json, as registered) supplies all of it, the way an operator reading the files expects. An empty list ([]) in that source counts as setting it, to nothing.

Methods

Get(IConfiguration?, string)

The list at key from the highest-priority source that sets it, in index order; null when no source sets it.

public static string[]? Get(IConfiguration? configuration, string key)

Parameters

configuration IConfiguration
key string

Returns

string[]