Class ConventionsBuilderExtensions
Extension methods for IConventionsBuilder.
Inheritance
System.Object
ConventionsBuilderExtensions
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.Conventions
Assembly: Kephas.Core.dll
Syntax
public static class ConventionsBuilderExtensions
Methods
| Improve this Doc View SourceForInstance<TService>(IConventionsBuilder, TService)
Defines a registration for the specified type and its singleton instance.
Declaration
public static void ForInstance<TService>(this IConventionsBuilder conventionsBuilder, TService instance)
Parameters
Type | Name | Description |
---|---|---|
IConventionsBuilder | conventionsBuilder | The conventionsBuilder to act on. |
TService | instance | The singleton instance. |
Type Parameters
Name | Description |
---|---|
TService | Type of the registered service. |
ForInstanceFactory<TService>(IConventionsBuilder, Func<ICompositionContext, TService>)
Defines a registration for the specified type and its instance factory.
Declaration
public static IPartBuilder ForInstanceFactory<TService>(this IConventionsBuilder conventionsBuilder, Func<ICompositionContext, TService> factory)
Parameters
Type | Name | Description |
---|---|---|
IConventionsBuilder | conventionsBuilder | The conventionsBuilder to act on. |
System.Func<ICompositionContext, TService> | factory | The instance factory. |
Returns
Type | Description |
---|---|
IPartBuilder | A IPartBuilder to further configure the rule. |
Type Parameters
Name | Description |
---|---|
TService | Type of the registered service. |
RegisterConventions(IConventionsBuilder, IList<Type>, ICompositionRegistrationContext)
Adds the conventions from the provided types implementing IConventionsRegistrar.
Declaration
public static IConventionsBuilder RegisterConventions(this IConventionsBuilder builder, IList<Type> parts, ICompositionRegistrationContext registrationContext)
Parameters
Type | Name | Description |
---|---|---|
IConventionsBuilder | builder | The builder. |
System.Collections.Generic.IList<System.Type> | parts | The parts. |
ICompositionRegistrationContext | registrationContext | Context for the registration. |
Returns
Type | Description |
---|---|
IConventionsBuilder | The convention builder. |
RegisterConventionsFrom(IConventionsBuilder, IEnumerable<Assembly>, IList<Type>, ICompositionRegistrationContext)
Adds the conventions from types implementing IConventionsRegistrar found in the provided assemblies.
Declaration
public static IConventionsBuilder RegisterConventionsFrom(this IConventionsBuilder builder, IEnumerable<Assembly> assemblies, IList<Type> parts, ICompositionRegistrationContext registrationContext)
Parameters
Type | Name | Description |
---|---|---|
IConventionsBuilder | builder | The builder. |
System.Collections.Generic.IEnumerable<System.Reflection.Assembly> | assemblies | The assemblies. |
System.Collections.Generic.IList<System.Type> | parts | The parts. |
ICompositionRegistrationContext | registrationContext | Context for the registration. |
Returns
Type | Description |
---|---|
IConventionsBuilder | The convention builder. |