2021-11-20 13:52:28 +01:00
|
|
|
namespace zero.Persistence;
|
2021-11-19 14:59:24 +01:00
|
|
|
|
|
|
|
|
public static class ZeroIndexExtensions
|
|
|
|
|
{
|
2021-11-26 12:31:33 +01:00
|
|
|
internal static void RunModifiers<T>(this T index, RavenOptions options) where T : IZeroIndexDefinition
|
2021-11-19 14:59:24 +01:00
|
|
|
{
|
2021-11-26 12:31:33 +01:00
|
|
|
IEnumerable<RavenIndexModifiersOptions.Modifier> modifiers = options.Indexes.Modifiers.GetAllForType(index.GetType());
|
2021-11-19 14:59:24 +01:00
|
|
|
|
|
|
|
|
foreach (RavenIndexModifiersOptions.Modifier modifier in modifiers)
|
|
|
|
|
{
|
|
|
|
|
Action<IZeroIndexDefinition> action = modifier.Modify.Compile();
|
|
|
|
|
action.Invoke(index);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|