Class VenflowServiceCollectionExtensions
Provides a set of useful extension methods for the
Namespace: Venflow.AspNetCore
Assembly: Venflow.AspNetCore.dll
Syntax
public static class VenflowServiceCollectionExtensions : object
Methods
| Improve this Doc View SourceAddDatabase<TDatabase>(IServiceCollection, Nullable<Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>>, ServiceLifetime)
Registers the TDatabase
as a service in the services
.
Declaration
public static IServiceCollection AddDatabase<TDatabase>(this IServiceCollection services, Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>? optionsAction = null, ServiceLifetime databaseLifetime = null)
where TDatabase : Database
Parameters
Type | Name | Description |
---|---|---|
IService |
services | The |
Nullable<Action<IService |
optionsAction | Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified |
Service |
databaseLifetime | The liftetime with which to register the |
Returns
Type | Description |
---|---|
IService |
The same service collection so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TDatabase | The type of the database to be registered. |
AddDatabase<TDatabase>(IServiceCollection, Nullable<Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>>, ServiceLifetime, ServiceLifetime)
Registers the TDatabase
as a service in the services
.
Declaration
public static IServiceCollection AddDatabase<TDatabase>(this IServiceCollection services, Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>? optionsAction = null, ServiceLifetime databaseLifetime = null, ServiceLifetime optionsLifetime = null)
where TDatabase : Database
Parameters
Type | Name | Description |
---|---|---|
IService |
services | The |
Nullable<Action<IService |
optionsAction | Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified |
Service |
databaseLifetime | The liftetime with which to register the |
Service |
optionsLifetime | The liftetime with which to register the DatabaseOptionsBuilder<TDatabase> service in the container. |
Returns
Type | Description |
---|---|
IService |
The same service collection so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TDatabase | The type of the database to be registered. |
AddDatabase<TDatabase>(IServiceCollection, Nullable<Action<DatabaseOptionsBuilder<TDatabase>>>, ServiceLifetime)
Registers the TDatabase
as a service in the services
.
Declaration
public static IServiceCollection AddDatabase<TDatabase>(this IServiceCollection services, Action<DatabaseOptionsBuilder<TDatabase>>? optionsAction = null, ServiceLifetime databaseLifetime = null)
where TDatabase : Database
Parameters
Type | Name | Description |
---|---|---|
IService |
services | The |
Nullable<Action<Database |
optionsAction | Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified |
Service |
databaseLifetime | The liftetime with which to register the |
Returns
Type | Description |
---|---|
IService |
The same service collection so that multiple calls can be chained. |
Type Parameters
Name | Description |
---|---|
TDatabase | The type of the database to be registered. |
AddVenflowJson(IServiceCollection)
Adds support for Venflows build in strongly-typed id to System.Text.Json.
Declaration
public static IServiceCollection AddVenflowJson(this IServiceCollection services)
Parameters
Type | Name | Description |
---|---|---|
IService |
services | The |
Returns
Type | Description |
---|---|
IService |
The same service collection so that multiple calls can be chained. |
Remarks
If you are using Newtonsoft.Json, please use Venflow.NewtonsoftJson