Class ProtoHostBuilderExtensions

Namespace
ProtoTest.Sql
Assembly
ProtoTest.Sql.dll
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.

public static IProtoHostBuilder AddSql(this IProtoHostBuilder builder, Func<IServiceProvider, DbConnection> connectionFactory, Action<SqlOptions>? configure = null)

Parameters

builder IProtoHostBuilder
connectionFactory Func<IServiceProvider, DbConnection>
configure Action<SqlOptions>

Returns

IProtoHostBuilder