Class ProtoHostBuilderExtensions
public static class ProtoHostBuilderExtensions
- Inheritance
-
ProtoHostBuilderExtensions
- Inherited Members
Methods
AddSql(IProtoHostBuilder, Func<IServiceProvider, DbConnection>, Action<SqlOptions>?)
Gives every test its own DbConnection, opened and owned as a resource. The factory runs inside the test scope, so it can read a container's connection string from per-test state. Any access technology can share that connection - Entity Framework Core, Dapper or raw ADO.NET. A second registration is a no-op: the first call's factory and options win. A host that registered its own SqlOptions keeps them and the rest of the integration composes around them.
public static IProtoHostBuilder AddSql(this IProtoHostBuilder builder, Func<IServiceProvider, DbConnection> connectionFactory, Action<SqlOptions>? configure = null)
Parameters
builderIProtoHostBuilderconnectionFactoryFunc<IServiceProvider, DbConnection>configureAction<SqlOptions>
Returns
Remarks
Declare AddressKeys in configure to make the
integration inert when no declared key can provide the connection: the Store capability is then
absent, the connection is not opened during setup, and the accessors throw naming the keys.