示例#1
0
 /// <inheritdoc/>
 public virtual object?GetContext(string id)
 {
     if (!string.IsNullOrEmpty(id))
     {
         Func <object>?locator = null;
         if (ContextLocator?.TryGetValue(id, out locator) == true)
         {
             return(locator?.Invoke());
         }
     }
     return(null);
 }
示例#2
0
 ///<inheritdoc/>
 public virtual object?GetContext(string id)
 {
     if (!string.IsNullOrEmpty(id))
     {
         Func <object>?locator = null;
         if (ContextLocator?.TryGetValue(id, out locator) == true)
         {
             return(locator?.Invoke());
         }
     }
     Debug.WriteLine($"Context with provided id={id} is not registered");
     return(null);
 }