Class AutofacPartBuilder
An Autofac part builder.
Inheritance
System.Object
AutofacPartBuilder
Implements
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.Autofac.Conventions
Assembly: Kephas.Composition.Autofac.dll
Syntax
public class AutofacPartBuilder : IPartBuilder
Constructors
| Improve this Doc View SourceAutofacPartBuilder(ContainerBuilder, IRegistrationBuilder<Object, SimpleActivatorData, SingleRegistrationStyle>)
Initializes a new instance of the AutofacPartBuilder class.
Declaration
public AutofacPartBuilder(ContainerBuilder containerBuilder, IRegistrationBuilder<object, SimpleActivatorData, SingleRegistrationStyle> registrationBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| Autofac.ContainerBuilder | containerBuilder | The container builder. |
| Autofac.Builder.IRegistrationBuilder<System.Object, Autofac.Builder.SimpleActivatorData, Autofac.Builder.SingleRegistrationStyle> | registrationBuilder | The registration builder. |
Methods
| Improve this Doc View SourceAllowMultiple(Boolean)
Indicates that this service allows multiple registrations.
Declaration
public IPartBuilder AllowMultiple(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | value | True if multiple service registrations are allowed, false otherwise. |
Returns
| Type | Description |
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. |
Build(IEnumerable<Type>)
Builds the information into a service descriptor.
Declaration
public void Build(IEnumerable<Type> parts)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Type> | parts | The parts. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | Thrown when the requested operation is invalid. |
Scoped()
Mark the part as being shared within the scope.
Declaration
public IPartBuilder Scoped()
Returns
| Type | Description |
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. |
Singleton()
Mark the part as being shared within the entire composition.
Declaration
public IPartBuilder Singleton()
Returns
| Type | Description |
|---|---|
| IPartBuilder | A part builder allowing further configuration of the part. |