更新代码
This commit is contained in:
1 parent
127fc22de5
commit
45829fa267
26 files changed
+139
-90
No files matched your search
@@ -359,16 +359,11 @@ if (AppFileHelper.PickFolder(out string path)) { FolderPath = path; }
|
||||
|
||||
XAML 细则见 `wpf-xaml.mdc`。
|
||||
|
||||
## 数据映射(忽略)
|
||||
## 服务端实体与 WPF 展示模型
|
||||
|
||||
使用 Mapster:
|
||||
|
||||
```csharp
|
||||
using PipeReviewReport.Shared;
|
||||
|
||||
var dto = model.Adapt<XxxDto>();
|
||||
var model = dto.Adapt<XxxModel>();
|
||||
```
|
||||
- 服务端返回的业务实体命名为 `XxxInfo`(如 `UserInfo`),放在独立的 `Store.Management.Models` 项目中,可脱离 API 和 WPF 使用。
|
||||
- WPF 视图绑定展示模型。单个实体的展示模型命名为 `XxxViewModel`(如 `UserViewModel`),集合中的每个元素命名为 `XxxItemViewModel`(如 `IReadOnlyList<UserItemViewModel>` 中的 `UserItemViewModel`)。
|
||||
- 从服务端实体到展示模型的转换使用 Riok.Mapperly,映射类放在使用方项目的 `Mappers/` 目录。
|
||||
|
||||
## 资源引用(忽略)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ disable-model-invocation: false
|
||||
|
||||
| 文件 | 加载策略 | 内容范围 |
|
||||
|---|---|---|
|
||||
| `.agents/rules/wpf-core.md` | alwaysApply: true | 项目结构、命名约定、ViewModel、MVVM属性、Command、服务、DI、对话框、LoadingStatus、文件对话框/文件夹选择、输入限长、Mapster |
|
||||
| `.agents/rules/wpf-core.md` | alwaysApply: true | 项目结构、命名约定、ViewModel、MVVM属性、Command、服务、DI、对话框、LoadingStatus、文件对话框/文件夹选择、输入限长、实体与展示模型映射 |
|
||||
| `.agents/rules/csharp-syntax.md` | alwaysApply: true | C# 语法硬约束(禁止 var、null检查、Debug.WriteLine、DRY等) |
|
||||
| `.agents/rules/architecture.md` | alwaysApply: true | 技术栈、项目架构、编译校验 |
|
||||
| `.agents/rules/editor-conventions.md` | alwaysApply: true | 换行符、编码规范 |
|
||||
|
||||
Reference in new issue
Block a user