Example #1
0
        /// <summary>
        /// Set correlation vector
        /// </summary>
        /// <param name="cv">cv</param>
        /// <returns>this</returns>
        public WorkContextBuilder Set(CorrelationVector cv)
        {
            cv.Verify().IsNotNull();

            Cv = cv;
            return(this);
        }
Example #2
0
 /// <summary>
 /// Default construct
 /// </summary>
 public WorkContextBuilder()
 {
     Cv         = new CorrelationVector();
     Tag        = StringVector.Empty;
     EventLog   = new TelemetryLogNull();
     Dimensions = new EventDimensions();
 }
Example #3
0
 /// <summary>
 /// Default constructor for Empty
 /// </summary>
 public WorkContext()
 {
     Cv         = new CorrelationVector();
     Tag        = StringVector.Empty;
     Telemetry  = new TelemetryLogNull();
     Dimensions = EventDimensions.Empty;
 }
Example #4
0
        /// <summary>
        /// Construct work context, for values that are not known to be immutable, shallow copies are made
        /// </summary>
        /// <param name="cv">correlation vector</param>
        /// <param name="tag">code location tag</param>
        /// <param name="container">container</param>
        /// <param name="properties">properties (optional)</param>
        /// <param name="cancellationToken">Cancellation token</param>
        /// <param name="eventLog"></param>
        /// <param name="dimensions"></param>
        public WorkContext(
            CorrelationVector cv,
            StringVector tag,
            IServiceProvider?container,
            CancellationToken?cancellationToken = null,
            ITelemetry?eventLog         = null,
            IEventDimensions?dimensions = null
            )
        {
            cv.Verify().IsNotNull();
            cv.Verify().IsNotNull();

            Cv                = cv;
            Tag               = tag;
            Container         = container;
            CancellationToken = cancellationToken ?? CancellationToken.None;
            Telemetry         = eventLog ?? new TelemetryLogNull();
            Dimensions        = dimensions != null ? new EventDimensions(dimensions) : new EventDimensions();
        }