Skip to content

Commit a7b9436

Browse files
committed
Simplified option registration / Fixed Nullable property casing.
1 parent a554bd7 commit a7b9436

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

Shuttle.Core.TransactionScope/ServiceCollectionExtensions.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Microsoft.Extensions.DependencyInjection;
3+
using Microsoft.Extensions.Options;
34
using Shuttle.Core.Contract;
45

56
namespace Shuttle.Core.TransactionScope;
@@ -14,12 +15,7 @@ public static IServiceCollection AddTransactionScope(this IServiceCollection ser
1415

1516
builder?.Invoke(transactionScopeBuilder);
1617

17-
services.AddOptions<TransactionScopeOptions>().Configure(options =>
18-
{
19-
options.IsolationLevel = transactionScopeBuilder.Options.IsolationLevel;
20-
options.Timeout = transactionScopeBuilder.Options.Timeout;
21-
options.Enabled = transactionScopeBuilder.Options.Enabled;
22-
});
18+
services.AddSingleton(Options.Create(transactionScopeBuilder.Options));
2319

2420
if (services.Contains(ServiceDescriptor.Singleton<ITransactionScopeFactory, TransactionScopeFactory>()))
2521
{

Shuttle.Core.TransactionScope/Shuttle.Core.TransactionScope.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
6-
<nullable>enable</nullable>
6+
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

99
<ItemGroup>

0 commit comments

Comments
 (0)