Exemple #1
0
 public void Dispose()
 {
     if (oldValue == null)
     {
         properties.RemoveProperty(key);
     }
     else
     {
         properties.SetProperty(key, oldValue);
     }
 }
 public static IDisposable Use <TValue>(this IContextProperties properties, string key, TValue value)
 {
     properties.Current.TryGetValue(key, out var oldValue);
     properties.SetProperty(key, value);
     return(new ContextScope(key, oldValue, properties));
 }
Exemple #3
0
 public static void Set <TValue>(this IContextProperties properties, string key, TValue value)
 {
     properties.SetProperty(key, value);
 }