public async Task <IResultModel> Move(MenuMoveModel model) { var entity = await _menuRepository.FirstAsync(model.SourceId); if (entity == null) { return(ResultModel.NotExists); } if (model.SourceId == model.TargetId) { return(ResultModel.Failed("不能移动至原位置")); } entity.ParentId = model.TargetId; var result = await _menuRepository.UpdateAsync(entity); await ClearCache(); return(ResultModel.Result(result)); }
public Task <IResultModel> Move(MenuMoveModel model) { return(_service.Move(model)); }