优化代码

This commit is contained in:
不做码农
2022-06-09 21:15:30 +08:00
parent e209c4a192
commit 71bbc27b1e
15 changed files with 44 additions and 55 deletions

View File

@@ -104,12 +104,10 @@ namespace ZR.Admin.WebApi.Controllers
{
throw new CustomException("请求实体不能为空");
}
//从 Dto 映射到 实体
var modal = parm.Adapt<ArticleCategory>().ToUpdate(HttpContext);
var response = _ArticleCategoryService.Update(w => w.CategoryId == modal.CategoryId, it => new ArticleCategory()
{
//Update 字段映射
Name = modal.Name,
ParentId = modal.ParentId,
});