ComponentRegistration<TService>
Registration for a single type as a component with the kernel.
You can create a new registration with the Component factory.
The concrete type that implements the service.
To set the implementation, use ImplementedBy .
Set the lifestyle of this component. For example singleton and transient (also known as 'factory').
The name of the component. Will become the key for the component in the kernel.
To set the name, use Named .
If not set, the FullName of the Implementation will be used as the key to register the component.
Set proxy for this component.
public ComponentRegistration()
Initializes a new instance of the ComponentRegistration<T> class.
Initializes a new instance of the ComponentRegistration<T> class.
public ComponentRegistration<TService> Activator<TActivator>() where TActivator : IComponentActivator
Set a custom IComponentActivator which creates and destroys the component.
Adds the attribute descriptor.
Adds the descriptor.
Creates an attribute descriptor.
Apply more complex configuration to this component registration.
Apply more complex configuration to this component registration.
Defines additional dependencies for the component. Those can be any of ServiceOverride, Property and Parameter. Use the static methods on
Dependency class to define the dependencies. See the example attached.
Defines additional dependencies for the component. Those can be any combibation of ServiceOverride, Property and Parameter. Use the static methods
on Dependency class to define the dependencies. See the example attached.
Uses a dictionary of key/value pairs, to specify custom dependencies.
Uses a dictionary of key/value pairs, to specify custom dependencies.
Uses an (anonymous) object as a dictionary, to specify custom dependencies.
Allows custom dependencies to by defined dyncamically. Calling this overload is synonymous to using DynamicParameters
Allows custom dependencies to by defined dynamically with releasing capability. Calling this overload is synonymous to using
DynamicParameters
public ComponentRegistration<TService> DependsOn(DynamicParametersWithContextResolveDelegate resolve)
Allows custom dependencies to by defined dynamically with releasing capability. Calling this overload is synonymous to using
DynamicParameters
Allows custom dependencies to by defined dynamically.
Allows custom dependencies to by defined dynamically with releasing capability.
public ComponentRegistration<TService> DynamicParameters(DynamicParametersWithContextResolveDelegate resolve)
Allows custom dependencies to by defined dynamically with releasing capability.
Sets ExtendedProperties for this component.
Sets ExtendedProperties for this component.
Sets ExtendedProperties for this component.
Adds types as additional services to be exposed by this component.
Adds TService2 as additional service to be exposed by this component.
Adds TService2 and TService3 as additional services to be exposed by this component.
Adds TService2 , TService3 and TService4 as additional services to be exposed by this component.
Adds TService2 , TService3 , TService4 and TService5 as additional services to be exposed by
this component.
Adds types as additional services to be exposed by this component.
Sets the concrete type that implements the service to TImpl .
If not set, the class service type or first registered interface will be used as the implementation for this component.
Sets the concrete type that implements the service to type .
If not set, the class service type or first registered interface will be used as the implementation for this component.
public ComponentRegistration<TService> ImplementedBy(Type type, IGenericImplementationMatchingStrategy genericImplementationMatchingStrategy)
Sets the concrete type that implements the service to type .
If not set, the class service type or first registered interface will be used as the implementation for this component.
public ComponentRegistration<TService> ImplementedBy(Type type, IGenericServiceStrategy genericServiceStrategy)
Sets the concrete type that implements the service to type .
If not set, the class service type or first registered interface will be used as the implementation for this component.
public ComponentRegistration<TService> ImplementedBy(Type type, IGenericImplementationMatchingStrategy genericImplementationMatchingStrategy, IGenericServiceStrategy genericServiceStrategy)
Sets the concrete type that implements the service to type .
If not set, the class service type or first registered interface will be used as the implementation for this component.
Assigns an existing instance as the component for this registration.
Set the interceptors for this component.
Set the interceptors for this component.
public ComponentRegistration<TService> Interceptors<TInterceptor>() where TInterceptor : IInterceptor
Set the interceptor for this component.
public ComponentRegistration<TService> Interceptors<TInterceptor1, TInterceptor2>() where TInterceptor1 : IInterceptor where TInterceptor2 : IInterceptor
Set the interceptor for this component.
Set the interceptor for this component.
Overrides default behavior by making the current component the default for every service it exposes. The serviceFilter allows user to narrow down the number of services which
should be make defaults.
Overrides default behavior by making the current component the default for every service it exposes.
Overrides default behavior by making the current component the fallback for every service it exposes that serviceFilter returns true for. That is if another,
non-fallback, component will be registered exposing any of these same services as this component, that other component will take precedence over this one, regardless of order in which they are
registered.
Overrides default behavior by making the current component the fallback for every service it exposes. That is if another, non-fallback, component will be registered exposing any of the same services
as this component, that other component will take precedence over this one, regardless of order in which they are registered
Sets component lifestyle to scoped per farthest component on the resolution stack where implementation type is assignable to TBaseForRoot .
Sets component lifestyle to scoped per scope determined by scopeRootBinder
Sets component lifestyle to scoped per nearest component on the resolution stack where implementation type is assignable to TBaseForRoot .
Sets component lifestyle to specified one.
public ComponentRegistration<TService> LifestyleCustom<TLifestyleManager>() where TLifestyleManager : ILifestyleManager
Sets component lifestyle to specified one.
Sets component lifestyle to per thread.
public ComponentRegistration<TService> LifestylePooled(int? initialSize = default, int? maxSize = default)
Sets component lifestyle to pooled. If initialSize or maxSize are not set default values will be used.
Sets component lifestyle to scoped per explicit scope. If scopeAccessorType is provided, it will be used to access scope for the component. Otherwise the default scope accessor
will be used.
public ComponentRegistration<TService> LifestyleScoped<TScopeAccessor>() where TScopeAccessor : IScopeAccessor
Sets component lifestyle to scoped per explicit scope.
Sets component lifestyle to singleton.
Sets component lifestyle to transient.
Set a name of this registration. This is required if you have multiple components for a given service and want to be able to resolve some specific ones. Then you'd provide the name so that Windsor
knows which one of the bunch you know. Otherwise don't bother setting the name.
If not set, the FullName of the Implementation will be used as the key to register the component.
This method as opposed to Named should be used by tools like facilities when the name is not provided by the user, but autogenerated and user has no interest in seing this name, for
example in diagnostics reports. Set a name of this registration. This is required if you have multiple components for a given service and want to be able to resolve some specific ones. Then you'd
provide the name so that Windsor knows which one of the bunch you know. Otherwise don't bother setting the name.
If not set, the FullName of the Implementation will be used as the key to register the component.
Stores a set of LifecycleActionDelegate<T> which will be invoked when the component is created and before it's returned from the container.
Stores a set of LifecycleActionDelegate<T> which will be invoked when the component is created and before it's returned from the container.
Stores a set of LifecycleActionDelegate<T> which will be invoked when the component is created and before it's returned from the container.
Stores a set of LifecycleActionDelegate<T> which will be invoked when the component is destroyed which means when it's released or it's lifetime scope ends. Notice that usage of this
method will cause instsances of the component to be tracked, even if they wouldn't be otherwise.
Services that are already present in the container will be skipped. If no new service is left the registration will not happen at all.
With the overwrite.
Filters (settable) properties of the component's implementation type to expose in the container and specifies if matched properties are considered mandatory.
Filters (settable) properties of the component's implementation type to ignore.
public ComponentRegistration<TService> PropertiesIgnore(Func<ComponentModel, PropertyInfo, bool> propertySelector)
Filters (settable) properties of the component's implementation type to ignore.
Filters (settable) properties of the component's implementation type to expose in the container as mandatory dependencies
public ComponentRegistration<TService> PropertiesRequire(Func<ComponentModel, PropertyInfo, bool> propertySelector)
Filters (settable) properties of the component's implementation type to expose in the container as mandatory dependencies
Sets the interceptor selector for this component.
public ComponentRegistration<TService> SelectInterceptorsWith(Action<ItemRegistration<IInterceptorSelector>> selector)
Sets the interceptor selector for this component.
public ComponentRegistration<TService> UsingFactory<TFactory, TServiceImpl>(Func<TFactory, TServiceImpl> factory) where TServiceImpl : TService
Uses a factory to instantiate the component
public ComponentRegistration<TService> UsingFactoryMethod<TImpl>(Func<TImpl> factoryMethod, bool managedExternally = false) where TImpl : TService
Uses a factory method to instantiate the component.
public ComponentRegistration<TService> UsingFactoryMethod<TImpl>(Func<IKernel, TImpl> factoryMethod, bool managedExternally = false) where TImpl : TService
Uses a factory method to instantiate the component.
public ComponentRegistration<TService> UsingFactoryMethod<TImpl>(Func<IKernel, ComponentModel, CreationContext, TImpl> factoryMethod, bool managedExternally = false) where TImpl : TService
Uses a factory method to instantiate the component.
public ComponentRegistration<TService> UsingFactoryMethod<TImpl>(Func<IKernel, CreationContext, TImpl> factoryMethod) where TImpl : TService
Uses a factory method to instantiate the component.