Merge pull request #8665 from umbraco/netcore/more-linux-optimizations

Netcore: Optimizations for non-windows development
This commit is contained in:
Bjarke Berg
2020-08-20 08:16:30 +02:00
committed by GitHub
5 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using Examine;
using Umbraco.Examine;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Infrastructure.Examine
{
public class NoopBackOfficeExamineSearcher : IBackOfficeExamineSearcher
{
public IEnumerable<ISearchResult> Search(string query, UmbracoEntityTypes entityType, int pageSize, long pageIndex, out long totalFound,
string searchFrom = null, bool ignoreUserStartNodes = false)
{
totalFound = 0;
return Enumerable.Empty<ISearchResult>();
}
}
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using System.Linq;
using Examine;
using Umbraco.Examine;
namespace Umbraco.Infrastructure.Examine
{
public class NoopUmbracoIndexesCreator : IUmbracoIndexesCreator
{
public IEnumerable<IIndex> Create()
{
return Enumerable.Empty<IIndex>();
}
}
}

View File

@@ -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<IUmbracoComponentRenderer, UmbracoComponentRenderer>();
// Register noop versions for examine to be overridden by examine
composition.RegisterUnique<IUmbracoIndexesCreator, NoopUmbracoIndexesCreator>();
composition.RegisterUnique<IBackOfficeExamineSearcher, NoopBackOfficeExamineSearcher>();
}
}
}

View File

@@ -32,7 +32,7 @@
<ItemGroup>
<ProjectReference Include="..\Umbraco.Configuration\Umbraco.Configuration.csproj" />
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
<ProjectReference Include="..\Umbraco.Examine.Lucene\Umbraco.Examine.Lucene.csproj" />
<ProjectReference Include="..\Umbraco.Examine.Lucene\Umbraco.Examine.Lucene.csproj" Condition="'$(OS)' == 'Windows_NT'" />
<ProjectReference Include="..\Umbraco.Infrastructure\Umbraco.Infrastructure.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
</ItemGroup>

View File

@@ -17,6 +17,7 @@
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
<ProjectReference Include="..\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
<ProjectReference Include="..\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
<ProjectReference Include="..\Umbraco.Persistance.SqlCe\Umbraco.Persistance.SqlCe.csproj" Condition="'$(OS)' == 'Windows_NT'" />
</ItemGroup>
<ItemGroup>