Updates to latest Examine version

The latest Examine version has some API breaking changes - namely it shouldn't have been relying on IOptionsSnapshot and instead IOptionsMonitor.
This commit is contained in:
Shannon
2021-08-26 11:36:24 -06:00
parent 48fcfcae21
commit e34b593b79
9 changed files with 11 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
LuceneIndex index,
ILogger<LuceneIndexDiagnostics> logger,
IHostingEnvironment hostingEnvironment,
IOptionsSnapshot<LuceneDirectoryIndexOptions> indexOptions)
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions)
{
_hostingEnvironment = hostingEnvironment;
_indexOptions = indexOptions.Get(index.Name);

View File

@@ -21,7 +21,7 @@
<None Remove="obj\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Examine" Version="2.0.0-beta.154" />
<PackageReference Include="Examine" Version="2.0.0-beta.168" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View File

@@ -23,7 +23,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
public UmbracoContentIndex(
ILoggerFactory loggerFactory,
string name,
IOptionsSnapshot<LuceneDirectoryIndexOptions> indexOptions,
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState,
ILocalizationService languageService = null)

View File

@@ -32,7 +32,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
protected UmbracoExamineIndex(
ILoggerFactory loggerFactory,
string name,
IOptionsSnapshot<LuceneDirectoryIndexOptions> indexOptions,
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState)
: base(loggerFactory, name, indexOptions)

View File

@@ -18,7 +18,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
UmbracoExamineIndex index,
ILogger<UmbracoExamineIndexDiagnostics> logger,
IHostingEnvironment hostingEnvironment,
IOptionsSnapshot<LuceneDirectoryIndexOptions> indexOptions)
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions)
: base(index, logger, hostingEnvironment, indexOptions)
{
_index = index;

View File

@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
public UmbracoMemberIndex(
ILoggerFactory loggerFactory,
string name,
IOptionsSnapshot<LuceneDirectoryIndexOptions> indexOptions,
IOptionsMonitor<LuceneDirectoryIndexOptions> indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState)
: base(loggerFactory, name, indexOptions, hostingEnvironment, runtimeState)

View File

@@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Examine.Lucene" Version="2.0.0-beta.154" />
<PackageReference Include="Examine.Lucene" Version="2.0.0-beta.168" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />

View File

@@ -241,8 +241,8 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine
// return i;
//}
public static IOptionsSnapshot<LuceneDirectoryIndexOptions> GetOptions(string indexName, LuceneDirectoryIndexOptions options)
=> Mock.Of<IOptionsSnapshot<LuceneDirectoryIndexOptions>>(x => x.Get(indexName) == options);
public static IOptionsMonitor<LuceneDirectoryIndexOptions> GetOptions(string indexName, LuceneDirectoryIndexOptions options)
=> Mock.Of<IOptionsMonitor<LuceneDirectoryIndexOptions>>(x => x.Get(indexName) == options);
internal void IndexingError(object sender, IndexingErrorEventArgs e) => throw new ApplicationException(e.Message, e.Exception);

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
@@ -74,7 +74,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Examine.Lucene" Version="2.0.0-beta.154" />
<PackageReference Include="Examine.Lucene" Version="2.0.0-beta.168" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />