public static IToken Intercept([NotNull] this IMutableContainer container, Key key, [NotNull][ItemNotNull] params IInterceptor[] interceptors) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (interceptors == null) { throw new ArgumentNullException(nameof(interceptors)); } return(container.GetRegistry().Register(container, (targetKey) => Filter(targetKey, key), interceptors)); }
public static IToken Intercept([NotNull] this IMutableContainer container, [NotNull] Predicate <Key> filter, [NotNull][ItemNotNull] params IInterceptor[] interceptors) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (filter == null) { throw new ArgumentNullException(nameof(filter)); } if (interceptors == null) { throw new ArgumentNullException(nameof(interceptors)); } return(container.GetRegistry().Register(container, filter, interceptors)); }