Search Results for

    Show / Hide Table of Contents

    Class VenflowServiceCollectionExtensions

    Provides a set of useful extension methods for the interface.

    Inheritance
    Object
    VenflowServiceCollectionExtensions
    Namespace: Venflow.AspNetCore
    Assembly: Venflow.AspNetCore.dll
    Syntax
    public static class VenflowServiceCollectionExtensions : object

    Methods

    | Improve this Doc View Source

    AddDatabase<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
    IServiceCollection services

    The to which the database will be registered.

    Nullable<Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>> optionsAction

    Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified TDatabase needs to have a public constructor with a DatabaseOptionsBuilder<TDatabase> parameter, which it passes to the base constructor.

    ServiceLifetime databaseLifetime

    The liftetime with which to register the TDatabase service in the container.

    Returns
    Type Description
    IServiceCollection

    The same service collection so that multiple calls can be chained.

    Type Parameters
    Name Description
    TDatabase

    The type of the database to be registered.

    | Improve this Doc View Source

    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
    IServiceCollection services

    The to which the database will be registered.

    Nullable<Action<IServiceProvider, DatabaseOptionsBuilder<TDatabase>>> optionsAction

    Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified TDatabase needs to have a public constructor with a DatabaseOptionsBuilder<TDatabase> parameter, which it passes to the base constructor.

    ServiceLifetime databaseLifetime

    The liftetime with which to register the TDatabase service in the container.

    ServiceLifetime optionsLifetime

    The liftetime with which to register the DatabaseOptionsBuilder<TDatabase> service in the container.

    Returns
    Type Description
    IServiceCollection

    The same service collection so that multiple calls can be chained.

    Type Parameters
    Name Description
    TDatabase

    The type of the database to be registered.

    | Improve this Doc View Source

    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
    IServiceCollection services

    The to which the database will be registered.

    Nullable<Action<DatabaseOptionsBuilder<TDatabase>>> optionsAction

    Allows to configure a DatabaseOptionsBuilder<TDatabase> for the database. Note, that the specified TDatabase needs to have a public constructor with a DatabaseOptionsBuilder<TDatabase> parameter, which it passes to the base constructor.

    ServiceLifetime databaseLifetime

    The liftetime with which to register the TDatabase service in the container.

    Returns
    Type Description
    IServiceCollection

    The same service collection so that multiple calls can be chained.

    Type Parameters
    Name Description
    TDatabase

    The type of the database to be registered.

    | Improve this Doc View Source

    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
    IServiceCollection services

    The to which the handler will be registered.

    Returns
    Type Description
    IServiceCollection

    The same service collection so that multiple calls can be chained.

    Remarks

    If you are using Newtonsoft.Json, please use Venflow.NewtonsoftJson

    Theme

    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 Twenty