Files
Umbraco-CMS/src/Umbraco.Infrastructure/Examine/IndexDiagnosticsFactory.cs

18 lines
570 B
C#

using Examine;
namespace Umbraco.Examine
{
/// <summary>
/// Default implementation of <see cref="IIndexDiagnosticsFactory"/> which returns <see cref="GenericIndexDiagnostics"/> for indexes that don't have an implementation
/// </summary>
public class IndexDiagnosticsFactory : IIndexDiagnosticsFactory
{
public virtual IIndexDiagnostics Create(IIndex index)
{
if (!(index is IIndexDiagnostics indexDiag))
indexDiag = new GenericIndexDiagnostics(index);
return indexDiag;
}
}
}