mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-21 07:51:23 +02:00
Update ProxyAndRecord
ProxyAndRecord does not save query-parameters, headers and body (#57)
This commit is contained in:
33
src/WireMock.Net/Util/DictionaryExtensions.cs
Normal file
33
src/WireMock.Net/Util/DictionaryExtensions.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JetBrains.Annotations;
|
||||
using WireMock.Validation;
|
||||
|
||||
namespace WireMock.Util
|
||||
{
|
||||
/// <summary>
|
||||
/// Some IDictionary Extensions
|
||||
/// </summary>
|
||||
public static class DictionaryExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Loops the dictionary and executes the specified action.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The type of the key.</typeparam>
|
||||
/// <typeparam name="TValue">The type of the value.</typeparam>
|
||||
/// <param name="dictionary">The dictionary to loop (can be null).</param>
|
||||
/// <param name="action">The action.</param>
|
||||
public static void Loop<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, [NotNull] Action<TKey, TValue> action)
|
||||
{
|
||||
Check.NotNull(action, nameof(action));
|
||||
|
||||
if (dictionary != null)
|
||||
{
|
||||
foreach (var entry in dictionary)
|
||||
{
|
||||
action(entry.Key, entry.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user