From 5d4de2c7667efa5508b8efece0fe1269f173f41b Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Thu, 2 Jun 2022 10:53:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapAdmin.DataAccess.PetaPoco/Services/TraceService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/TraceService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/TraceService.cs index 6956ee76..f5ee2fbb 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/TraceService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/TraceService.cs @@ -39,7 +39,6 @@ class TraceService : ITrace public (IEnumerable Items, int ItemsCount) GetAll(string? searchText, TraceFilter filter, int pageIndex, int pageItems, List sortList) { var sql = new Sql(); - using var db = DBManager.Create(); if (!string.IsNullOrEmpty(searchText)) { sql.Where("UserName Like @0 or Ip Like @0 or RequestUrl Like @0", $"%{searchText}%"); @@ -71,6 +70,7 @@ class TraceService : ITrace sql.OrderBy("Logtime desc"); } + using var db = DBManager.Create(); var data = db.Page(pageIndex, pageItems, sql); return (data.Items, Convert.ToInt32(data.TotalItems)); }