/// <summary> /// 校验创建操作 /// </summary> /// <param name="entity">实体</param> private async Task ValidateCreateAsync(Operation entity) { entity.CheckNull(nameof(entity)); if (!await OperationRepository.CanCreateAsync(entity)) { ThrowUriRepeatException(entity); } if (!await ModuleRepository.ExistsAsync(entity.ModuleId)) { throw new Warning("模块不存在"); } }