mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-11-19 15:18:44 +01:00
Upgrade dependency RamlToOpenApiConverter to version 0.40.0 (#1505)
* Upgrade dependency RamlToOpenApiConverter to version 0.40.0 * fix code comment * . * Potential fix for pull request finding 'Constant condition' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Constant condition' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * fix --------- Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
84f4109a7c
commit
f0969e9618
15 files changed
+158
-227
No files matched your search
@@ -1,10 +1,13 @@
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
#if NETSTANDARD2_0
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace System.Collections.Generic;
|
||||
|
||||
internal static class DictionaryExtensions
|
||||
{
|
||||
#if NETSTANDARD2_0
|
||||
public static bool TryAdd<TKey, TValue>(this Dictionary<TKey, TValue>? dictionary, TKey key, TValue value)
|
||||
{
|
||||
if (dictionary is null || dictionary.ContainsKey(key))
|
||||
@@ -16,5 +19,29 @@ internal static class DictionaryExtensions
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
public static bool TryGetFirstValue<TKey, TValue>(this IDictionary<TKey, TValue>? dictionary, out TValue? value)
|
||||
{
|
||||
if (dictionary != null && dictionary.Count > 0)
|
||||
{
|
||||
value = dictionary.First().Value;
|
||||
return true;
|
||||
}
|
||||
|
||||
value = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool TryGetFirstOrDefault<TKey, TValue>(this IDictionary<TKey, TValue>? dictionary, out KeyValuePair<TKey, TValue> value)
|
||||
{
|
||||
if (dictionary != null && dictionary.Count > 0)
|
||||
{
|
||||
value = dictionary.First();
|
||||
return true;
|
||||
}
|
||||
|
||||
value = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user