CorrelationId icon indicating copy to clipboard operation
CorrelationId copied to clipboard

ICorrelationContextAccessor has setter

Open MatthewLymer opened this issue 5 years ago • 1 comments

Hello and thank you for the awesome library, it's very useful for me!

One thing I noticed is that ICorrelationContextAccessor has a setter on its only property CorrelationContext.

When this dependency is injected into a class, is it expected that the dependent type is able to modify the context via the interface?

My thinking is that dependents that need the correlation context shouldn't be able to change it too.

Can you clarify whether this is intended, or whether you'd accept a PR to change this behavior?

Cheers, Matthew

MatthewLymer avatar Sep 02 '20 20:09 MatthewLymer

Thanks, @MatthewLymer. I'm trying to recall if I had a reason for this and I can't think of one. I think it would be reasonable to make it an internal setter. Since this would be a breaking change, it would need to go into a v4 release. I'd welcome a PR against the v4 branch if you have time. Thanks!

stevejgordon avatar Sep 30 '20 16:09 stevejgordon