public NestedContext(INestedContext parent, T value) { Parent = parent; Value = value; CreatedTimeUtcTicks = DateTime.UtcNow.Ticks; // Low time resolution, but okay fast FrameLevel = parent?.FrameLevel + 1 ?? 1; }
public NestedContext(INestedContext parent, T value) { Parent = parent; Value = value; CreatedTime = DateTime.UtcNow; // Low time resolution, but okay fast _frameLevel = parent != null ? parent.FrameLevel + 1 : 1; }
public NestedContext(INestedContext parent, T value) { Parent = parent; Value = value; CreatedTimeUtcTicks = DateTime.UtcNow.Ticks; FrameLevel = parent?.FrameLevel + 1 ?? 1; }
private static void SetThreadLocal(INestedContext newValue) { if (newValue == null) { CallContext.FreeNamedDataSlot(NestedDiagnosticsContextKey); } else { CallContext.LogicalSetData(NestedDiagnosticsContextKey, newValue); } }
private static void SetThreadLocal(INestedContext newValue) { #if NET4_6 || NETSTANDARD AsyncNestedDiagnosticsContext.Value = newValue; #else if (newValue == null) { System.Runtime.Remoting.Messaging.CallContext.FreeNamedDataSlot(NestedDiagnosticsContextKey); } else { System.Runtime.Remoting.Messaging.CallContext.LogicalSetData(NestedDiagnosticsContextKey, newValue); } #endif }
public static INestedContext CreateNestedContext(INestedContext parent, T value) { #if NET4_6 || NETSTANDARD return(new NestedContext <T>(parent, value)); #else if (typeof(T).IsValueType || Convert.GetTypeCode(value) != TypeCode.Object) { return(new NestedContext <T>(parent, value)); } else { return(new NestedContext <ObjectHandleSerializer>(parent, new ObjectHandleSerializer(value))); } #endif }
public NestedContext(INestedContext parent, T value) { Parent = parent; Value = value; FrameLevel = parent != null ? parent.FrameLevel + 1 : 1; }
private static void SetThreadLocal(INestedContext newValue) { AsyncNestedDiagnosticsContext.Value = newValue; }
public NestedContext(INestedContext parent, string value) { Value = value; Parent = parent; FrameLevel = parent?.FrameLevel + 1 ?? 1; }
public static INestedContext CreateNestedContext(INestedContext parent, string value) { return(new NestedContext(parent, value)); }