Files
mixtape/zero.Core/Persistence/Indexes/ZeroIndexExtensions.cs
T
2021-12-16 13:55:09 +01:00

16 lines
498 B
C#

namespace zero.Persistence;
public static class ZeroIndexExtensions
{
internal static void RunModifiers<T>(this T index, RavenOptions options) where T : IZeroIndexDefinition
{
IEnumerable<RavenIndexModifiersOptions.Modifier> modifiers = options.Indexes.Modifiers.GetAllForType(index.GetType());
foreach (RavenIndexModifiersOptions.Modifier modifier in modifiers)
{
Action<IZeroIndexDefinition> action = modifier.Modify.Compile();
action.Invoke(index);
}
}
}