ข้ามไปยังเนื้อหา

Class ProjectConfigurationBuilderExtensions

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

Namespace: Cephalon.Engine.Configuration
Assembly: Cephalon.Engine.dll

Adds Cephalon project-configuration conventions to a configuration builder.

public static class ProjectConfigurationBuilderExtensions

objectProjectConfigurationBuilderExtensions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Cephalon keeps configuration-driven features friendly to large projects by supporting a split-file convention under a project's Configurations folder.

The current convention loads root-level Add*.json files first, then loads every {Environment}.json file found under the folder tree. These sources are inserted ahead of standard host overrides such as appsettings.json, appsettings.{Environment}.json, user secrets, environment variables, and command-line arguments so projects can keep Cephalon defaults grouped by concern without losing the normal ASP.NET Core and generic-host override path.

Gets the default root folder name used for split project configuration files.

public const string DefaultRootFolderName = "Configurations"

string

AddCephalonProjectConfigurations(IConfigurationBuilder, string, string, string)

Section titled “ AddCephalonProjectConfigurations(IConfigurationBuilder, string, string, string)”

Adds Cephalon project-configuration conventions to the supplied configuration builder.

public static IConfigurationBuilder AddCephalonProjectConfigurations(this IConfigurationBuilder configuration, string contentRootPath, string environmentName, string rootFolderName = "Configurations")

configuration IConfigurationBuilder

The configuration builder to extend.

contentRootPath string

The project content root that owns the Configurations folder.

environmentName string

The current host environment name, such as Development or Local.

rootFolderName string

The split-configuration root folder name. The default value is .

IConfigurationBuilder

The same configuration builder for fluent composition.

The convention currently loads:

  • Configurations/Add*.json
  • Configurations/**/{Environment}.json

Existing JSON configuration sources are not duplicated when this method is called more than once.