A parameter that contains the controller context and action descriptor for the filter.
Inheritance: Ninject.Parameters.Parameter
 /// <summary>
 /// Gets the filters configured in Ninject.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="actionDescriptor">The action descriptor.</param>
 /// <returns>The filters configured in Ninject.</returns>
 public IEnumerable<FilterInfo> GetFilters(HttpConfiguration configuration, HttpActionDescriptor actionDescriptor)
 {
     var parameter = new FilterContextParameter(configuration, actionDescriptor);
     return this.kernel.GetAll<INinjectFilter>(parameter).Select(filter => filter.BuildFilter(parameter));
 }
 /// <summary>
 /// Builds the filter instance.
 /// </summary>
 /// <param name="parameter">The parameter.</param>
 /// <returns>The created filter.</returns>
 public FilterInfo BuildFilter(FilterContextParameter parameter)
 {
     return(new FilterInfo(
                this.kernel.Get <T>(m => m.Get(BindingRootExtensions.FilterIdMetadataKey, Guid.Empty).Equals(this.filterId), parameter),
                this.scope));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the filters configured in Ninject.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="actionDescriptor">The action descriptor.</param>
        /// <returns>The filters configured in Ninject.</returns>
        public IEnumerable <FilterInfo> GetFilters(HttpConfiguration configuration, HttpActionDescriptor actionDescriptor)
        {
            var parameter = new FilterContextParameter(configuration, actionDescriptor);

            return(this.kernel.GetAll <INinjectFilter>(parameter).Select(filter => filter.BuildFilter(parameter)));
        }