From f29968f37954992b59b0279539d0f31942a22f27 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Thu, 23 Sep 2021 14:44:11 -0400 Subject: [PATCH] conditional re-index --- AppScaffolding/AppScaffolding.csproj | 2 +- LibationWinForms/Program.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AppScaffolding/AppScaffolding.csproj b/AppScaffolding/AppScaffolding.csproj index 1382447b..606e86a4 100644 --- a/AppScaffolding/AppScaffolding.csproj +++ b/AppScaffolding/AppScaffolding.csproj @@ -3,7 +3,7 @@ net5.0 - 6.0.6.1 + 6.0.6.2 diff --git a/LibationWinForms/Program.cs b/LibationWinForms/Program.cs index cde703b9..b8b25c21 100644 --- a/LibationWinForms/Program.cs +++ b/LibationWinForms/Program.cs @@ -275,8 +275,9 @@ namespace LibationWinForms } // in order: save to db, full reindex from db, refresh ui - context.SaveChanges(); - ApplicationServices.SearchEngineCommands.FullReIndex(); + var changed = context.SaveChanges(); + if (changed > 0) + ApplicationServices.SearchEngineCommands.FullReIndex(); UserDefinedItem.BatchMode_Finalize(); // only do this after save changes