Definition
Assembly: Microsoft.Restier.Core.dll Namespace: Microsoft.Restier.Core Inheritance: System.ObjectSyntax
Summary
The default Dependency Injection container builder for Restier.Constructors
.ctor
Initializes a new instance of the RestierContainerBuilder class.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
configureApis | System.Action<Microsoft.Restier.Core.RestierApiBuilder> | Action to configure the ApiBase registrations that are available to the Container. |
Remarks
The API registrations are re-created every time because new Containers are spun up per-route. It make make more sense to create a static instance to do this, so the Dictionary is only created once..ctor Inherited
Inherited from
objectSyntax
Methods
AddService
Adds a service of serviceType with an implementationType.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
lifetime | Microsoft.OData.ServiceLifetime | The lifetime of the service to register. |
serviceType | System.Type | The type of the service to register. |
implementationType | System.Type | The implementation type of the service. |
Returns
Type:Microsoft.OData.IContainerBuilder
The IContainerBuilder instance itself.
AddService
Adds a service of serviceType with an implementationFactory.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
lifetime | Microsoft.OData.ServiceLifetime | The lifetime of the service to register. |
serviceType | System.Type | The type of the service to register. |
implementationFactory | System.Func<System.IServiceProvider, object> | The factory that creates the service. |
Returns
Type:Microsoft.OData.IContainerBuilder
The IContainerBuilder instance itself.
BuildContainer Virtual
Builds a container which implements IServiceProvider and contains all the services registered for a specific route.Syntax
Returns
Type:System.IServiceProvider
The IServiceProviderdependency injection container</see> for the registered services.
Remarks
RWM: For unit test scenarios, this container may be built without any APIs opr Routes. If you are experiencing unexpected behavior, turn on Tracing so you can see the warning messages Restier might be generating.Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Related APIs
- Microsoft.OData.IContainerBuilder