public static void TrapInject <TIn, TOut>(this IInjectable <TIn, TOut> injectable, Func <TIn, bool> filter, Func <TIn, TOut> func, InjectionPriority priority = InjectionPriority.Middle) { injectable.Inject(v => filter(v) ? InjectionResult.Trap <TIn, TOut>(func(v)) : InjectionResult.PassThru <TIn, TOut>(), priority); }
public static void TrapInject <TIn>(this IInjectable <TIn> injectable, Func <TIn, bool> filter, Action <TIn> func, InjectionPriority priority = InjectionPriority.Middle) { injectable.Inject(filter, v => { func(v); return(InjectionResult.Trap <TIn>()); }, priority); }
public static void Inject <TIn>(this IInjectable <TIn> injectable, Func <TIn, bool> filter, Func <TIn, IInjectionResult <TIn> > func, InjectionPriority priority = InjectionPriority.Middle) { injectable.Inject(v => filter(v) ? func(v) : InjectionResult.PassThru <TIn>(), priority); }