Skip to content
Merged
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 @@ -34,9 +34,9 @@ public class BrighterOptions : IBrighterOptions
public InstrumentationOptions InstrumentationOptions { get; set; }

/// <summary>
/// Configures the lifetime of mappers. Defaults to Singleton
/// Configures the lifetime of mappers. Defaults to transit
/// </summary>
public ServiceLifetime MapperLifetime { get; set; } = ServiceLifetime.Singleton;
public ServiceLifetime MapperLifetime { get; set; } = ServiceLifetime.Transient;

/// <summary>
/// Configures the polly policy registry.
Expand All @@ -51,9 +51,7 @@ public class BrighterOptions : IBrighterOptions
/// <summary>
/// Configures the lifetime of any transformers. Defaults to Singleton
/// </summary>
public ServiceLifetime TransformerLifetime { get; set; } = ServiceLifetime.Singleton;


public ServiceLifetime TransformerLifetime { get; set; } = ServiceLifetime.Transient;
}

public interface IBrighterOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static IBrighterBuilder BrighterHandlerBuilder(IServiceCollection service
public static IBrighterBuilder AddProducers(
this IBrighterBuilder brighterBuilder,
Action<ProducersConfiguration> configure,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
ServiceLifetime serviceLifetime = ServiceLifetime.Transient)
{
if (brighterBuilder is null)
throw new ArgumentNullException($"{nameof(brighterBuilder)} cannot be null.", nameof(brighterBuilder));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ShouldHaveTestHandlerRegisteredCorrectly()
[Fact]
public void ShouldHaveTestMapperRegisteredCorrectly()
{
TestRegistration(typeof(TestEventMessageMapper), ServiceLifetime.Singleton);
TestRegistration(typeof(TestEventMessageMapper), ServiceLifetime.Transient);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void ShouldHaveTestHandlerRegisteredCorrectly()
[Fact]
public void ShouldHaveTestMapperRegisteredCorrectly()
{
TestRegistration(typeof(TestEventMessageMapper), ServiceLifetime.Singleton);
TestRegistration(typeof(TestEventMessageMapper), ServiceLifetime.Transient);
}

[Fact]
Expand Down
Loading