Skip to content

Commit e3ad267

Browse files
committed
Added CorrelationContext
1 parent f74864c commit e3ad267

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace EasyWay.Internals.Contexts
2+
{
3+
internal sealed class DefaultCorrelationContext : ICorrelationContext
4+
{
5+
public DefaultCorrelationContext()
6+
{
7+
CorrelationId = Guid.NewGuid();
8+
}
9+
10+
public Guid CorrelationId { get; }
11+
}
12+
}

source/EasyWay/Internals/Contexts/Extensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ internal static IServiceCollection AddContexts(this IServiceCollection services)
1010
services.AddScoped<ICancellationContext, CancellationContext>();
1111

1212
services.AddScoped<IUserContext, DefaultUserContext>();
13+
services.AddScoped<ICorrelationContext, DefaultCorrelationContext>();
1314

1415
return services;
1516
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace EasyWay.Internals.Contexts
2+
{
3+
internal interface ICorrelationContext
4+
{
5+
Guid CorrelationId { get; }
6+
}
7+
}

0 commit comments

Comments
 (0)