Definition
Assembly: Microsoft.Extensions.DependencyInjection.Abstractions.dll Namespace: Microsoft.Extensions.DependencyInjectionSyntax
Summary
This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions.Remarks
See Microsoft documentation for more information about the rest of the API.Methods
AddChainedService Extension
Extension method from
Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection to register the TService with. |
factory | System.Func<System.IServiceProvider, TService, TService> | A factory method to create a new instance of service TService, wrapping previous instance.”/>. |
serviceLifetime | Microsoft.Extensions.DependencyInjection.ServiceLifetime | The ServiceLifetime of the service being added. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The services instance modified with the new TService reference.
Type Parameters
TService- The service type to register with the IServiceCollection.
Remarks
This process is being deprecated. Please DO NOT rely on it for future behavior in your own apps. V2 will properly handle multiple instances of a registration by firing them in succession.AddChainedService Extension
Extension method from
Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection to register the TService with. |
serviceLifetime | Microsoft.Extensions.DependencyInjection.ServiceLifetime | The ServiceLifetime of the service being added. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
Current IServiceCollection
Type Parameters
TService- The service type to register with the IServiceCollection.TImplement- The implementation type.
Remarks
This process is being deprecated. Please DO NOT rely on it for future behavior in your own apps. V2 will properly handle multiple instances of a registration by firing them in succession. If want to cutoff previous registration, not define a property with type of TService or do not use it. The contributor added will get an instance of TImplement from the container, i.e. IServiceProvider, every time it’s get called. This method will try to register TImplement as a service with Transient life time, if it’s not yet registered. To override, you can register TImplement before or after calling this method. Note: When registering TImplement, you must NOT give it a ServiceLifetime that makes it outlives TService, that could possibly make an instance of TImplement be used in multiple instantiations of TService, which leads to unpredictable behaviors.AddEF6ProviderServices Extension
Extension method from
Microsoft.Extensions.DependencyInjection.RestierEntityFrameworkServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
Current IServiceCollection.
Type Parameters
TDbContext- The DbContext type.
AddEFCoreProviderServices Extension
Extension method from
Microsoft.Extensions.DependencyInjection.RestierEntityFrameworkServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection. |
optionsAction | System.Action<System.IServiceProvider, Microsoft.EntityFrameworkCore.DbContextOptionsBuilder> | An optional action to configure the Microsoft.EntityFrameworkCore.DbContextOptions |
| for the context. This provides an alternative to performing configuration of | ||
| the context by overriding the Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | ||
| method in your derived context. | ||
| If an action is supplied here, the Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | ||
| method will still be run if it has been overridden on the derived context. Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder) | ||
| configuration will be applied in addition to configuration performed here. | ||
| In order for the options to be passed into your context, you need to expose a | ||
| constructor on your context that takes Microsoft.EntityFrameworkCore.DbContextOptions`1 | ||
| and passes it to the base constructor of Microsoft.EntityFrameworkCore.DbContext. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
Current IServiceCollection.
Type Parameters
TDbContext- The DbContext type.
AddRestier Extension
Extension method from
Microsoft.Extensions.DependencyInjection.Restier_IServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | - |
configureApisAction | System.Action<Microsoft.Restier.Core.RestierApiBuilder> | - |
useEndpointRouting | bool | - |
Returns
Type:Microsoft.Extensions.DependencyInjection.IMvcBuilder
AddRestier Extension
Extension method from
Microsoft.Extensions.DependencyInjection.Restier_IServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | - |
configureApisAction | System.Action<Microsoft.Restier.Core.RestierApiBuilder> | - |
mvcOptions | System.Action<Microsoft.AspNetCore.Mvc.MvcOptions> | - |
useEndpointRouting | bool | - |
Returns
Type:Microsoft.Extensions.DependencyInjection.IMvcBuilder
AddRestier Extension
Extension method from
Microsoft.Extensions.DependencyInjection.Restier_IServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | - |
alternateBaseUri | System.Uri | - |
configureApisAction | System.Action<Microsoft.Restier.Core.RestierApiBuilder> | - |
useEndpointRouting | bool | - |
Returns
Type:Microsoft.Extensions.DependencyInjection.IMvcBuilder
AddRestierSwagger Extension
Extension method from
Microsoft.Extensions.DependencyInjection.Restier_AspNetCore_Swagger_IServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection to register Swagger services with. |
openApiSettings | System.Action<Microsoft.OpenApi.OData.OpenApiConvertSettings> | An Action`1 that allows you to configure the core Swagger output. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
HasService Extension
Extension method from
Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection to register the TService with. |
Returns
Type:bool
A Boolean specifying whether or not the TService
Type Parameters
TService- The service type to register with the IServiceCollection.
HasServiceCount Extension
Extension method from
Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensionsSyntax
Parameters
| Name | Type | Description |
|---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The IServiceCollection to register the TService with. |
Returns
Type:int
An Int32 representing the number of Services that match the given ServiceType.
Type Parameters
TService- The service type to register with the IServiceCollection.