gx 配置
This commit is contained in:
1 parent
0e1620c1f9
commit
c732ecb1d2
7 files changed
+166
-16
No files matched your search
@@ -19,6 +19,16 @@ namespace MAX.Framework.Interfaces
|
||||
/// </summary>
|
||||
int Priority => MAX.Core.Interfaces.IntPriority.Normal;
|
||||
|
||||
/// <summary>
|
||||
/// 模块自己的配置文件(相对宿主输出目录 <see cref="AppContext.BaseDirectory"/>),
|
||||
/// 例如 "appsettings.CloudProduct.json";默认 null 表示该模块没有独立配置文件。
|
||||
/// 该文件由 <c>builder.AddStoreHub()</c> 自动并入宿主配置树(插在 appsettings*.json 之后、环境变量/命令行之前),
|
||||
/// 因此模块内的服务照常注入 <c>IConfiguration</c> 就能读到自己的配置节,模块之间互不干扰。
|
||||
/// 注意:只有 <c>builder.AddStoreHub()</c> 入口能加载模块配置文件,
|
||||
/// 直接用 <c>builder.Services.AddStoreHub()</c> 时拿不到 IConfigurationBuilder,模块配置不会生效。
|
||||
/// </summary>
|
||||
string? ConfigurationFile => null;
|
||||
|
||||
/// <summary>
|
||||
/// 服务注册阶段(<c>builder.Build()</c> 之前):注册本模块的服务、选项、后台任务类型。
|
||||
/// 需要读配置时用 <see cref="ModuleContext.Configuration"/>,不要再去碰 <c>builder</c>。
|
||||
|
||||
@@ -12,6 +12,9 @@ namespace MAX.Framework.Interfaces
|
||||
/// <inheritdoc />
|
||||
public virtual int Priority => IntPriority.Normal;
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual string? ConfigurationFile => null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract void AddModule(ModuleContext context);
|
||||
|
||||
|
||||
Reference in new issue
Block a user