protected static void CopyProperties(IActivityScope source, Dictionary <string, object> target, IEnumerable <KeyValuePair <Enum, string> > enumToKeyMappings) { foreach (KeyValuePair <Enum, string> keyValuePair in enumToKeyMappings) { ExtensibleLogger.CopyProperty(source, target, keyValuePair.Key, keyValuePair.Value, false); } }
private static void CopyProperty(IActivityScope source, Dictionary <string, object> target, Enum sourceKey, string targetKey, bool isPII) { string property = source.GetProperty(sourceKey); if (property == null) { return; } if (target.ContainsKey(targetKey)) { throw new ArgumentException(string.Format("targetKey '{0}' is already being used by another property: {1}", targetKey, sourceKey)); } target.Add(targetKey, isPII ? ExtensibleLogger.FormatPIIValue(property) : property); }
protected static void CopyProperty(IActivityScope source, Dictionary <string, object> target, Enum sourceKey, string targetKey) { ExtensibleLogger.CopyProperty(source, target, sourceKey, targetKey, false); }