mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
refactor(setting): 移除设置应用器注册方法中的new()约束
- 从RegisterApplicator方法的泛型约束中移除new()要求 - 修改实现类SettingsModel中的方法签名以匹配接口变更 - 更新抽象层ISettingsModel中的方法约束定义 - 保持原有功能完整性的同时提高代码灵活性 - [release ci]
This commit is contained in:
parent
6172ce96f1
commit
209c331d1f
@ -39,7 +39,7 @@ public interface ISettingsModel : IModel
|
||||
/// <param name="applicator">要注册的设置应用器</param>
|
||||
/// <returns>当前设置模型实例,支持链式调用</returns>
|
||||
ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
|
||||
where T : class, IResetApplyAbleSettings, new();
|
||||
where T : class, IResetApplyAbleSettings;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -63,7 +63,7 @@ public class SettingsModel<TRepository> : AbstractModel, ISettingsModel
|
||||
/// 注册设置应用器
|
||||
/// </summary>
|
||||
public ISettingsModel RegisterApplicator<T>(IResetApplyAbleSettings applicator)
|
||||
where T : class, IResetApplyAbleSettings, new()
|
||||
where T : class, IResetApplyAbleSettings
|
||||
{
|
||||
_applicators[typeof(T)] = applicator;
|
||||
return this;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user