mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 19:24:29 +08:00
fix(setting): 修复设置应用器注册方法的泛型约束
- 将RegisterApplicator方法的泛型约束从ISettingsData改为IResetApplyAbleSettings - 更新接口定义中的泛型参数约束 - 修正相关XML文档注释中的接口名称描述 - [release ci]
This commit is contained in:
parent
7d581f07ca
commit
6172ce96f1
@ -35,10 +35,11 @@ public interface ISettingsModel : IModel
|
||||
/// <summary>
|
||||
/// 注册设置应用器
|
||||
/// </summary>
|
||||
/// <typeparam name="T">设置数据类型,必须实现ISettingsData接口且具有无参构造函数</typeparam>
|
||||
/// <typeparam name="T">设置数据类型,必须实现IResetApplyAbleSettings接口且具有无参构造函数</typeparam>
|
||||
/// <param name="applicator">要注册的设置应用器</param>
|
||||
/// <returns>当前设置模型实例,支持链式调用</returns>
|
||||
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator) where T : class, ISettingsData, new();
|
||||
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
|
||||
where T : class, IResetApplyAbleSettings, new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -63,7 +63,7 @@ public class SettingsModel<TRepository> : AbstractModel, ISettingsModel
|
||||
/// 注册设置应用器
|
||||
/// </summary>
|
||||
public ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
|
||||
where T : class, ISettingsData, new()
|
||||
where T : class, IResetApplyAbleSettings, new()
|
||||
{
|
||||
_applicators[typeof(T)] = applicator;
|
||||
return this;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user