Method AddRedbRouteSql(IServiceCollection, Action<SqlConfigurationBuilder>?)
Registers the in the route context so that
sql: URIs are resolved.
Named data sources are registered in the context registry via
context.AddToRegistry(name, ISqlConnectionFactory).
The method can be called more than once (one module, one call): every call adds its data sources and named queries
to the same component and the same registry.
services.AddRedbRoute(route =>
{
route.Services.AddRedbRouteSql(sql =>
{
sql.AddDataSource("main", opts =>
{
opts.ConnectionString = "Server=...";
opts.ProviderName = "Microsoft.Data.SqlClient";
});
});
route.AddRouteBuilder<MyRoutes>();
});
public static IServiceCollection AddRedbRouteSql(this IServiceCollection services, Action<SqlConfigurationBuilder>? configure = null)