| | |
| | | public async Task<Guid> Handle(SaveMenuCommand request, CancellationToken cancellationToken) |
| | | { |
| | | return await request.SaveData<Menu, SaveMenuCommand>( |
| | | q => q.Include(it => it.Children), |
| | | it => |
| | | it.UserType == request.UserType |
| | | && it.ClientType == request.ClientType |
| | |
| | | && it.Id != request.Id, |
| | | (entity) => |
| | | { |
| | | entity.Path = DbUtils.GetTreeDataPath<DictionaryData>(request.ParentId, cancellationToken).Result; |
| | | entity.Path = DbUtils.GetTreeDataPath<Menu>(request.ParentId, cancellationToken).Result; |
| | | if (request.Id.HasValue) |
| | | { |
| | | if (entity.UserType != request.UserType) throw Oops.Oh(EnumErrorCodeType.s410, "用户类型"); |