Class ServiceCollectionExtensions
- Assembly
- Dapper.SimpleSqlBuilder.DependencyInjection.dll
An extension class for IServiceCollection to configure the Simple SQL builder.
public static class ServiceCollectionExtensions
Inheritance
Methods
AddSimpleSqlBuilder(IServiceCollection, ServiceLifetime)
Adds services for the Simple SQL builder.
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
Parameters
service
IServiceCollection-
The IServiceCollection to add services to.
serviceLifetime
ServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
service
is 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
service
IServiceCollection-
The IServiceCollection to add services to.
configure
Action<SimpleBuilderOptions>-
The action to configure the SimpleBuilderOptions.
serviceLifetime
ServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
service
orconfigure
is 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
service
IServiceCollection-
The IServiceCollection to add services to.
configurationSectionPath
string-
The name of the configuration section to bind to the SimpleBuilderOptions.
serviceLifetime
ServiceLifetime-
The ServiceLifetime for the ISimpleBuilder.
Returns
- IServiceCollection
-
The IServiceCollection instance.
Exceptions
- ArgumentNullException
-
Thrown when
service
is null or whenconfigurationSectionPath
is null, empty or white-space.