/// <summary>
 /// Builds the filter instance.
 /// </summary>
 /// <param name="parameter">The parameter.</param>
 /// <returns>The created filter.</returns>
 public Filter BuildFilter(FilterContextParameter parameter)
 {
     return(new Filter(
                this.kernel.Get <T>(m => m.Get(BindingRootExtensions.FilterIdMetadataKey, Guid.Empty).Equals(this.filterId), parameter),
                this.scope,
                this.order));
 }
 /// <summary>
 /// Builds the filter instances.
 /// </summary>
 /// <param name="parameter">The parameter.</param>
 /// <returns>The created filters.</returns>
 public IEnumerable <Filter> BuildFilters(FilterContextParameter parameter)
 {
     for (int i = 0; i < this.NumberOfFilters; i++)
     {
         parameter.AttributePosition = i;
         yield return(new Filter(
                          this.kernel.Get <T>(m => m.Get(BindingRootExtensions.FilterIdMetadataKey, Guid.Empty).Equals(this.filterId), parameter),
                          this.scope,
                          this.order));
     }
 }
        /// <summary>
        /// Gets the filters.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <param name="actionDescriptor">The action descriptor.</param>
        /// <returns>All filters defined on the kernel.</returns>
        public IEnumerable <Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
        {
            var parameter = new FilterContextParameter(controllerContext, actionDescriptor);

            return(this.kernel.GetAll <INinjectFilter>(parameter).Select(filter => filter.BuildFilter(parameter)));
        }
 /// <summary>
 /// Gets the filters.
 /// </summary>
 /// <param name="controllerContext">The controller context.</param>
 /// <param name="actionDescriptor">The action descriptor.</param>
 /// <returns>All filters defined on the kernel.</returns>
 public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
 {
     var parameter = new FilterContextParameter(controllerContext, actionDescriptor);
     return this.kernel.GetAll<INinjectFilter>(parameter).Select(filter => filter.BuildFilter(parameter));
 }