更新代码
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/` 目录。
|
||||
|
||||
## 资源引用(忽略)
|
||||
|
||||
|
||||
Reference in new issue
Block a user