Class ServiceRegistrationBuilderExtensions
Extensions for the service registration builder.
Inheritance
System.Object
ServiceRegistrationBuilderExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Composition.Lite
Assembly: Kephas.Core.dll
Syntax
public static class ServiceRegistrationBuilderExtensions
Methods
| Improve this Doc View SourceKeyed<TContract>(IServiceRegistrationBuilder)
Sets the registration key to a super type of the service type.
Declaration
public static IServiceRegistrationBuilder Keyed<TContract>(this IServiceRegistrationBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationBuilder | builder | The builder to act on. |
Returns
Type | Description |
---|---|
IServiceRegistrationBuilder | This builder. |
Type Parameters
Name | Description |
---|---|
TContract | The type of registration. |
Remarks
The registration type is the key to find the service. The registered service type is a subtype providing additional information, typically metadata.
WithFactory(IServiceRegistrationBuilder, Func<Object>)
Registers the service with the provided factory.
Declaration
public static IServiceRegistrationBuilder WithFactory(this IServiceRegistrationBuilder builder, Func<object> factory)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationBuilder | builder | The builder to act on. |
System.Func<System.Object> | factory | The factory. |
Returns
Type | Description |
---|---|
IServiceRegistrationBuilder | This builder. |
WithType<TImplementation>(IServiceRegistrationBuilder)
Registers the service with the provided implementation type.
Declaration
public static IServiceRegistrationBuilder WithType<TImplementation>(this IServiceRegistrationBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IServiceRegistrationBuilder | builder | The builder to act on. |
Returns
Type | Description |
---|---|
IServiceRegistrationBuilder | This builder. |
Type Parameters
Name | Description |
---|---|
TImplementation | Type of the implementation. |