コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }