using Opsoft.NetCore.O3App.Domain; using Opsoft.NetCore.O3App.Domain.Models; using System.Threading; namespace Opsoft.NetCore.O3App.Infrastructure { /// public class TraceContextAccessor : ITraceContextAccessor { private static AsyncLocal traceContext = new AsyncLocal(); private volatile int transactionSequence; /// public TraceContext TraceContext { get => traceContext.Value; set => traceContext.Value = value; } /// public long TransactionSequence => Interlocked.Increment(ref transactionSequence); } }