Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class HostApplicationBuilderWorkflowExtensions
/// <exception cref="InvalidOperationException">
/// Thrown when the factory delegate returns null or a workflow with a name that doesn't match the expected name.
/// </exception>
public static IHostedWorkflowBuilder AddWorkflow(this IHostApplicationBuilder builder, string name, Func<IServiceProvider, string, Workflow> createWorkflowDelegate, ServiceLifetime lifetime = ServiceLifetime.Singleton)
public static IHostedWorkflowBuilder AddWorkflow(this IHostApplicationBuilder builder, string name, Func<IServiceProvider, string, Workflow> createWorkflowDelegate, ServiceLifetime lifetime = ServiceLifetime.Transient)
{
Throw.IfNull(builder);
Throw.IfNull(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public void AddWorkflow_ValidParameters_ReturnsBuilder()
}

/// <summary>
/// Verifies that AddWorkflow registers the workflow as a keyed singleton service by default.
/// Verifies that AddWorkflow registers the workflow as a keyed transient service by default.
/// </summary>
[Fact]
public void AddWorkflow_RegistersKeyedSingleton()
public void AddWorkflow_RegistersKeyedTransient()
{
var builder = new HostApplicationBuilder();
const string WorkflowName = "testWorkflow";
Expand All @@ -78,7 +78,7 @@ public void AddWorkflow_RegistersKeyedSingleton()
d.ServiceType == typeof(Workflow));

Assert.NotNull(descriptor);
Assert.Equal(ServiceLifetime.Singleton, descriptor.Lifetime);
Assert.Equal(ServiceLifetime.Transient, descriptor.Lifetime);
}

/// <summary>
Expand Down