internal static bool TryGetFromCache(string cmdletNoun, out ReferencePathGenerator referencePathGenerator) { if (string.IsNullOrEmpty(cmdletNoun)) { throw new ArgumentException("Cmdlet noun cannot be null or empty", nameof(cmdletNoun)); } return(Cache.TryGetValue(cmdletNoun, out referencePathGenerator)); }
internal static void AddToCache(string cmdletNoun, ReferencePathGenerator referencePathGenerator) { if (string.IsNullOrEmpty(cmdletNoun)) { throw new ArgumentException("Cmdlet noun cannot be null or empty", nameof(cmdletNoun)); } if (referencePathGenerator == null) { throw new ArgumentNullException(nameof(referencePathGenerator)); } Cache[cmdletNoun] = referencePathGenerator; }