docs(core): 更新文档中的代码格式和类型标记

- 修复 IfType<T, TResult> 扩展方法的类型格式显示
- 更正 Contains<T>() 方法的类型标记格式
- 统一代码块标记为正确的 ```csharp 格式
- 修正 IQuery<TResult> 接口的类型标记显示
This commit is contained in:
GeWuYou 2026-02-11 14:16:52 +08:00
parent 50a71403bb
commit 033e2b076a
3 changed files with 6 additions and 6 deletions

View File

@ -252,7 +252,7 @@ obj.IfType<IRule>(
); );
``` ```
#### IfType<T, TResult> 扩展方法 #### IfType`<T, TResult>` 扩展方法
```csharp ```csharp
public static TResult? IfType<T, TResult>( public static TResult? IfType<T, TResult>(

View File

@ -381,7 +381,7 @@ var allServices = container.GetAll<IDataService>(); // 返回两个实例的列
## 其他实用方法 ## 其他实用方法
### `Contains<T>()` ### Contains`<T>`()
检查容器中是否包含指定类型的实例。 检查容器中是否包含指定类型的实例。
@ -439,7 +439,7 @@ public bool ContainsInstance(object instance)
**使用示例:** **使用示例:**
``csharp ```csharp
var container = new IocContainer(); var container = new IocContainer();
var service = new MyService(); var service = new MyService();
@ -609,7 +609,7 @@ public class GameArchitecture : Architecture
### 2. 使用接口类型注册 ### 2. 使用接口类型注册
``csharp ```csharp
// ❌ 不推荐:直接使用实现类 // ❌ 不推荐:直接使用实现类
RegisterSystem(new ConcreteSystem()); RegisterSystem(new ConcreteSystem());
var system = GetSystem<ConcreteSystem>(); var system = GetSystem<ConcreteSystem>();
@ -621,7 +621,7 @@ var system = GetSystem<IGameSystem>();
### 3. 避免运行时频繁注册 ### 3. 避免运行时频繁注册
``csharp ``` csharp
// ❌ 不好:游戏运行时频繁注册 // ❌ 不好:游戏运行时频繁注册
void Update() void Update()
{ {

View File

@ -7,7 +7,7 @@ Query 包实现了 CQRS命令查询职责分离模式中的查询部分。
## 核心接口 ## 核心接口
### IQuery<TResult> ### IQuery`<TResult>`
查询接口,定义了查询的基本契约。 查询接口,定义了查询的基本契约。