![]() |
VOOZH | about |
dotnet add package NickSoftware.Switchboard.Extensions.DependencyInjection --version 0.1.0-preview.68
NuGet\Install-Package NickSoftware.Switchboard.Extensions.DependencyInjection -Version 0.1.0-preview.68
<PackageReference Include="NickSoftware.Switchboard.Extensions.DependencyInjection" Version="0.1.0-preview.68" />
<PackageVersion Include="NickSoftware.Switchboard.Extensions.DependencyInjection" Version="0.1.0-preview.68" />Directory.Packages.props
<PackageReference Include="NickSoftware.Switchboard.Extensions.DependencyInjection" />Project file
paket add NickSoftware.Switchboard.Extensions.DependencyInjection --version 0.1.0-preview.68
#r "nuget: NickSoftware.Switchboard.Extensions.DependencyInjection, 0.1.0-preview.68"
#:package NickSoftware.Switchboard.Extensions.DependencyInjection@0.1.0-preview.68
#addin nuget:?package=NickSoftware.Switchboard.Extensions.DependencyInjection&version=0.1.0-preview.68&prereleaseInstall as a Cake Addin
#tool nuget:?package=NickSoftware.Switchboard.Extensions.DependencyInjection&version=0.1.0-preview.68&prereleaseInstall as a Cake Tool
Dependency injection and IoC container extensions for the Switchboard Amazon Connect framework.
⚠️ PREVIEW RELEASE: Part of the Switchboard preview release. APIs may change.
This package provides Microsoft.Extensions.DependencyInjection integration for the Switchboard framework, enabling:
dotnet add package NickSoftware.Switchboard.Extensions.DependencyInjection --prerelease
This package is typically installed alongside the main Switchboard package:
dotnet add package NickSoftware.Switchboard --prerelease
dotnet add package NickSoftware.Switchboard.Extensions.DependencyInjection --prerelease
using Switchboard.Extensions.DependencyInjection;
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddSwitchboard(options =>
{
options.InstanceName = "MyCallCenter";
options.Region = "us-east-1";
});
var host = builder.Build();
var app = host.Services.GetRequiredService<ISwitchboardApp>();
// Using appsettings.json
builder.Services.AddSwitchboard(builder.Configuration);
// appsettings.json
{
"Switchboard": {
"InstanceName": "MyCallCenter",
"Region": "us-east-1",
"EnableLogging": true
}
}
Automatically discover and register flow builders and resource providers:
builder.Services.AddSwitchboard(options => { })
.AddAssemblyScanning(typeof(Program).Assembly);
Flow builders are discovered by:
IDiscoverableFlowBuilder interface[FlowBuilder] attribute// Using interface
public class MainFlowBuilder : IDiscoverableFlowBuilder
{
public IFlow Build() => Flow.Create("MainFlow")
.PlayPrompt("Welcome")
.Build();
}
// Using attribute
[FlowBuilder]
public class SupportFlowBuilder
{
public IFlow Build() => Flow.Create("SupportFlow")
.PlayPrompt("Support line")
.Build();
}
Register and configure middleware for flow validation and processing:
builder.Services.AddSwitchboard(options => { })
.UseMiddleware<LoggingMiddleware>()
.UseMiddleware<ValidationMiddleware>()
.UseMiddleware<MetricsMiddleware>();
Built-in middleware:
LoggingMiddleware - Logs flow building and validationValidationMiddleware - Validates flow structureLambdaValidationMiddleware - Validates Lambda configurationsMetricsMiddleware - Collects build metricspublic class CustomMiddleware : IFlowMiddleware
{
private readonly ILogger<CustomMiddleware> _logger;
public CustomMiddleware(ILogger<CustomMiddleware> logger)
{
_logger = logger;
}
public async Task InvokeAsync(FlowContext context, Func<Task> next)
{
_logger.LogInformation("Processing flow: {FlowName}", context.FlowName);
await next();
_logger.LogInformation("Flow processed successfully");
}
}
Configure custom validators:
builder.Services.AddSwitchboard(options => { })
.AddValidation(config =>
{
config.ValidateEmptyFlows = true;
config.ValidateTerminalActions = true;
config.ValidateTransitions = true;
});
Register configuration providers for queues, routing profiles, and hours of operation:
[ResourceProvider]
public class QueueProvider : IResourceProvider
{
public void Configure(ISwitchboardStack stack)
{
stack.AddQueue(Queue.Create("Sales")
.Build());
}
}
If you prefer explicit registration over scanning:
builder.Services.AddSwitchboard(options => { })
.AddFlowBuilders(typeof(MainFlowBuilder), typeof(SupportFlowBuilder))
.AddProviders(typeof(QueueProvider), typeof(HoursProvider));
builder.Services.AddSwitchboard(options =>
{
options.InstanceArn = "arn:aws:connect:us-east-1:123456789:instance/abc-123";
});
Part of the Switchboard framework for Amazon Connect
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.68 | 32 | 5/5/2026 |
| 0.1.0-preview.62 | 44 | 3/26/2026 |
| 0.1.0-preview.61 | 37 | 3/25/2026 |
| 0.1.0-preview.60 | 35 | 3/20/2026 |
| 0.1.0-preview.59 | 39 | 3/8/2026 |
| 0.1.0-preview.58 | 35 | 3/7/2026 |
| 0.1.0-preview.56 | 51 | 1/25/2026 |
| 0.1.0-preview.55 | 45 | 1/25/2026 |
| 0.1.0-preview.54 | 39 | 1/25/2026 |
| 0.1.0-preview.53 | 41 | 1/25/2026 |
| 0.1.0-preview.52 | 74 | 12/3/2025 |
| 0.1.0-preview.51 | 70 | 12/2/2025 |
| 0.1.0-preview.48 | 60 | 12/2/2025 |
| 0.1.0-preview.47 | 64 | 12/1/2025 |
| 0.1.0-preview.46 | 47 | 12/1/2025 |
| 0.1.0-preview.45 | 61 | 11/30/2025 |
| 0.1.0-preview.44 | 69 | 11/30/2025 |
| 0.1.0-preview.43 | 56 | 11/30/2025 |
| 0.1.0-preview.42 | 72 | 11/30/2025 |
Preview release - APIs may change. See documentation at https://nicksoftware.github.io/switchboard-docs/