From f528d8d0af98030e95c2c1baf41b636da3adb4cc Mon Sep 17 00:00:00 2001 From: Marvin Date: Thu, 21 Dec 2023 23:29:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9WriteBarcodeInfo4DataCarrie?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AMES/BarcodeInfoesController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs index f08a4ca6..394cb32b 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeInfoesController.cs @@ -384,8 +384,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { for (int i = 0; i < oldBarcodeItem.Count; i++) { - _context.BarcodeItems.Remove(oldBarcodeItem[i]); - await _context.SaveChangesAsync(); + try + { + _context.BarcodeItems.Remove(oldBarcodeItem[i]); + await _context.SaveChangesAsync(); + } + catch { } } }