From b288c99e5658859c3673065323a45a9780408297 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 19 Aug 2020 19:42:58 +0200 Subject: [PATCH 1/3] Register noop examine implementations in core, to be replaced by examine dll. --- .../Examine/NoopBackOfficeExamineSearcher.cs | 17 +++++++++++++++++ .../Examine/NoopUmbracoIndexesCreator.cs | 14 ++++++++++++++ .../Runtime/CoreInitialComposer.cs | 5 ++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs create mode 100644 src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs diff --git a/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs b/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs new file mode 100644 index 0000000000..22695f426f --- /dev/null +++ b/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using Examine; +using Umbraco.Examine; +using Umbraco.Web.Models.ContentEditing; + +namespace Umbraco.Infrastructure.Examine +{ + public class NoopBackOfficeExamineSearcher : IBackOfficeExamineSearcher + { + public IEnumerable Search(string query, UmbracoEntityTypes entityType, int pageSize, long pageIndex, out long totalFound, + string searchFrom = null, bool ignoreUserStartNodes = false) + { + totalFound = 0; + return new ISearchResult[0]; + } + } +} diff --git a/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs b/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs new file mode 100644 index 0000000000..1507b8f143 --- /dev/null +++ b/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using Examine; +using Umbraco.Examine; + +namespace Umbraco.Infrastructure.Examine +{ + public class NoopUmbracoIndexesCreator : IUmbracoIndexesCreator + { + public IEnumerable Create() + { + return new IIndex[0]; + } + } +} diff --git a/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs b/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs index 4f1109a8cb..852c617750 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs @@ -30,6 +30,7 @@ using Umbraco.Core.Services.Implement; using Umbraco.Core.Strings; using Umbraco.Core.Sync; using Umbraco.Examine; +using Umbraco.Infrastructure.Examine; using Umbraco.Infrastructure.Media; using Umbraco.Web; using Umbraco.Web.Actions; @@ -365,7 +366,9 @@ namespace Umbraco.Core.Runtime composition.RegisterUnique(); - + // Register noop versions for examine to be overridden by examine + composition.RegisterUnique(); + composition.RegisterUnique(); } } } From 091a777b62c3e06c07b43d342c71edda8918d1be Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 19 Aug 2020 19:51:06 +0200 Subject: [PATCH 2/3] Conditional load of netframework dlls --- src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj | 2 +- src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index 6711d507e8..0e98bc8cd7 100644 --- a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj +++ b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index 79f05b939f..f832deea13 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -17,6 +17,7 @@ + From f913aff5fb6f6adf40f240d4e605f0d7796f7c54 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 20 Aug 2020 08:15:07 +0200 Subject: [PATCH 3/3] Using Enumerable.Empty --- .../Examine/NoopBackOfficeExamineSearcher.cs | 3 ++- .../Examine/NoopUmbracoIndexesCreator.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs b/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs index 22695f426f..15ed8de389 100644 --- a/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs +++ b/src/Umbraco.Infrastructure/Examine/NoopBackOfficeExamineSearcher.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using Examine; using Umbraco.Examine; using Umbraco.Web.Models.ContentEditing; @@ -11,7 +12,7 @@ namespace Umbraco.Infrastructure.Examine string searchFrom = null, bool ignoreUserStartNodes = false) { totalFound = 0; - return new ISearchResult[0]; + return Enumerable.Empty(); } } } diff --git a/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs b/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs index 1507b8f143..a6133a7e59 100644 --- a/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs +++ b/src/Umbraco.Infrastructure/Examine/NoopUmbracoIndexesCreator.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using Examine; using Umbraco.Examine; @@ -8,7 +9,7 @@ namespace Umbraco.Infrastructure.Examine { public IEnumerable Create() { - return new IIndex[0]; + return Enumerable.Empty(); } } }