docs(GFramework.Core): 更新 ContextAwareServiceExtensions 文档注释

- 为 GetSystem 方法添加 InvalidOperationException 异常文档说明
- 为 GetModel 方法添加 InvalidOperationException 异常文档说明
- 为 GetUtility 方法添加 InvalidOperationException 异常文档说明
- 清理文件末尾多余空行
This commit is contained in:
GeWuYou 2026-03-28 13:06:01 +08:00
parent b5ac8b2c34
commit 6e3954eb3e

View File

@ -37,6 +37,7 @@ public static class ContextAwareServiceExtensions
/// <param name="contextAware">实现 IContextAware 接口的对象</param> /// <param name="contextAware">实现 IContextAware 接口的对象</param>
/// <returns>指定类型的系统实例</returns> /// <returns>指定类型的系统实例</returns>
/// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception> /// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception>
/// <exception cref="InvalidOperationException">当指定系统未注册时抛出</exception>
public static TSystem GetSystem<TSystem>(this IContextAware contextAware) where TSystem : class, ISystem public static TSystem GetSystem<TSystem>(this IContextAware contextAware) where TSystem : class, ISystem
{ {
ArgumentNullException.ThrowIfNull(contextAware); ArgumentNullException.ThrowIfNull(contextAware);
@ -52,6 +53,7 @@ public static class ContextAwareServiceExtensions
/// <param name="contextAware">实现 IContextAware 接口的对象</param> /// <param name="contextAware">实现 IContextAware 接口的对象</param>
/// <returns>指定类型的模型实例</returns> /// <returns>指定类型的模型实例</returns>
/// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception> /// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception>
/// <exception cref="InvalidOperationException">当指定模型未注册时抛出</exception>
public static TModel GetModel<TModel>(this IContextAware contextAware) where TModel : class, IModel public static TModel GetModel<TModel>(this IContextAware contextAware) where TModel : class, IModel
{ {
ArgumentNullException.ThrowIfNull(contextAware); ArgumentNullException.ThrowIfNull(contextAware);
@ -67,6 +69,7 @@ public static class ContextAwareServiceExtensions
/// <param name="contextAware">实现 IContextAware 接口的对象</param> /// <param name="contextAware">实现 IContextAware 接口的对象</param>
/// <returns>指定类型的工具实例</returns> /// <returns>指定类型的工具实例</returns>
/// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception> /// <exception cref="ArgumentNullException">当 contextAware 为 null 时抛出</exception>
/// <exception cref="InvalidOperationException">当指定工具未注册时抛出</exception>
public static TUtility GetUtility<TUtility>(this IContextAware contextAware) where TUtility : class, IUtility public static TUtility GetUtility<TUtility>(this IContextAware contextAware) where TUtility : class, IUtility
{ {
ArgumentNullException.ThrowIfNull(contextAware); ArgumentNullException.ThrowIfNull(contextAware);