Interface IPartConventionsBuilder
Contract for part conventions builders.
Namespace: Kephas.Composition.Conventions
Assembly: Kephas.Core.dll
Syntax
public interface IPartConventionsBuilder
Methods
| Improve this Doc View SourceAllowMultiple(Boolean)
Indicates that this service allows multiple registrations.
Declaration
IPartConventionsBuilder AllowMultiple(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | True if multiple service registrations are allowed, false otherwise. |
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
AsServiceType(Type)
Indicates the declared service type. Typically this is the same as the contract type, but this may get overwritten, for example when declaring generic type services for collecting metadata.
Declaration
IPartConventionsBuilder AsServiceType(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | serviceType | Type of the service. |
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Export(Action<IExportConventionsBuilder>)
Exports the part using the specified conventions builder.
Declaration
IPartConventionsBuilder Export(Action<IExportConventionsBuilder> conventionsBuilder = null)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IExportConventionsBuilder> | conventionsBuilder | The conventions builder. |
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
ExportInterface(Type, Action<Type, IExportConventionsBuilder>)
Select the interface on the part type that will be exported.
Declaration
IPartConventionsBuilder ExportInterface(Type exportInterface, Action<Type, IExportConventionsBuilder> exportConfiguration = null)
Parameters
Type | Name | Description |
---|---|---|
System.Type | exportInterface | The interface to export. |
System.Action<System.Type, IExportConventionsBuilder> | exportConfiguration | The export configuration. |
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Scoped()
Mark the part as being shared within the scope.
Declaration
IPartConventionsBuilder Scoped()
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo>, Action<ParameterInfo, IImportConventionsBuilder>)
Select which of the available constructors will be used to instantiate the part.
Declaration
IPartConventionsBuilder SelectConstructor(Func<IEnumerable<ConstructorInfo>, ConstructorInfo> constructorSelector, Action<ParameterInfo, IImportConventionsBuilder> importConfiguration = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo>, System.Reflection.ConstructorInfo> | constructorSelector | Filter that selects a single constructor. |
System.Action<System.Reflection.ParameterInfo, IImportConventionsBuilder> | importConfiguration | Action configuring the parameters of the selected constructor. |
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |
Singleton()
Mark the part as being shared within the entire composition.
Declaration
IPartConventionsBuilder Singleton()
Returns
Type | Description |
---|---|
IPartConventionsBuilder | A part builder allowing further configuration of the part. |