public static void RestoreProperties( [CanBeNull] string input, [NotNull] ContextProperties properties, [NotNull] ContextConfiguration configuration) { foreach (var(name, serializedValue) in ReadProperties(input, configuration.ErrorCallback)) { if (!configuration.DistributedProperties.TryGetValue(name, out var serializer)) { continue; } var value = DeserializeValue(name, serializedValue, serializer, configuration.ErrorCallback); if (value == null) { continue; } properties.Set(name, value); } }
public static string SerializeProperties( [NotNull] ContextProperties properties, [NotNull] ContextConfiguration configuration) { return(SerializeInternal(EnumerateProperties(properties, configuration), configuration.ErrorCallback)); }