new search index extension ability
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using zero.Core.Database;
|
||||
using zero.Core.Options;
|
||||
|
||||
namespace zero.Core.Extensions
|
||||
{
|
||||
public static class ZeroIndexExtensions
|
||||
{
|
||||
internal static void RunModifiers<T>(this T index, IZeroOptions options) where T : IZeroIndexDefinition
|
||||
{
|
||||
IEnumerable<RavenIndexModifiersOptions.Modifier> modifiers = options.Raven.Indexes.Modifiers.GetAllForType(index.GetType());
|
||||
|
||||
foreach (RavenIndexModifiersOptions.Modifier modifier in modifiers)
|
||||
{
|
||||
Action<IZeroIndexDefinition> action = modifier.Modify.Compile();
|
||||
action.Invoke(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user