protected override void Dispose(bool isDisposing) { ActivityEnricher = null; base.Dispose(isDisposing); }
/// <summary> /// Registers an <see cref="ActivityEnricher{TState}"/> that will be called to enrich the next <see cref="Activity"/> processed under the current scope if it has been sampled. /// </summary> /// <typeparam name="TState">State type.</typeparam> /// <param name="activityEnricher"><see cref="ActivityEnricher{TState}"/> to be called.</param> /// <param name="state">The state to pass to the <see cref="ActivityEnricher{TState}"/>.</param> /// <returns><see cref="IDisposable"/> to cancel the enrichment scope.</returns> public static IDisposable Begin <TState>(ActivityEnricher <TState> activityEnricher, TState state) => new GenericActivityEnrichmentScope <TState>(activityEnricher, state);
public GenericActivityEnrichmentScope(ActivityEnricher <TState> activityEnricher, TState state) { ActivityEnricher = activityEnricher ?? throw new ArgumentNullException(nameof(activityEnricher)); _State = state; }
public void Given_When_Then() { var class1 = new ActivityEnricher(); Assert.NotNull(class1); }