Class ServiceCollectionExtensions
- Assembly
- Dapper.SimpleSqlBuilder.DependencyInjection.dll
An extension class for IServiceCollection to configure the Simple SQL builder.
public static class ServiceCollectionExtensionsInheritance
Methods
AddSimpleSqlBuilder(IServiceCollection, ServiceLifetime)
Adds services for the Simple SQL builder.
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)Parameters
serviceIServiceCollection-
The IServiceCollection to add services to.
serviceLifetimeServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
serviceis null.
AddSimpleSqlBuilder(IServiceCollection, Action<SimpleBuilderOptions>, ServiceLifetime)
Adds services for the Simple SQL builder.
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, Action<SimpleBuilderOptions> configure, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)Parameters
serviceIServiceCollection-
The IServiceCollection to add services to.
configureAction<SimpleBuilderOptions>-
The action to configure the SimpleBuilderOptions.
serviceLifetimeServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
serviceorconfigureis null.
AddSimpleSqlBuilder(IServiceCollection, string, ServiceLifetime)
Adds services for the Simple SQL builder.
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, string configurationSectionPath, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)Parameters
serviceIServiceCollection-
The IServiceCollection to add services to.
configurationSectionPathstring-
The name of the configuration section to bind to the SimpleBuilderOptions.
serviceLifetimeServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
serviceis null or whenconfigurationSectionPathis null, empty or white-space.