Exemplo n.º 1
0
        public async Task <IHttpActionResult> DeleteAsync(int id, CancellationToken cancellationToken)
        {
            var rule = await _ruleManager.FindByIdAsync(id, RuleField.None, cancellationToken);

            if (rule != null)
            {
                await _ruleManager.DeleteAsync(rule, cancellationToken);
            }
            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public async Task <ResultEntity> DeleteByIdAsync(int id, int userId)
        {
            var result = await _barcodeRuleManager.DeleteAsync(id);

            if (result.Success)
            {
                await _unitOfWork.CommitAsync();

                await _logManager.LogInfomationAsync(EnumLogType.Audit, LogTitleConstString.BarcodeRuleDelete,
                                                     $"【{result.Data.Name}】已删除", JsonConvert.SerializeObject(result.Data), userId);
            }

            return(result);
        }