diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-03-07 21:08:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-07 21:08:57 +0100 |
| commit | 10a0d6bdba821449abfb1d48e9708ba6f3fc6a62 (patch) | |
| tree | 602be322daedca127ba66de07837ac8e792730a7 /MediaBrowser.Common/Extensions/CollectionExtensions.cs | |
| parent | ae0ecc1b10982d9240ecdcc82cb7299fc708aafb (diff) | |
| parent | 0abe57e930e44eab9566991f33b089d1e61cfb83 (diff) | |
Merge pull request #1010 from cvium/kestrel_poc
Remove System.Net and port to Kestrel
Diffstat (limited to 'MediaBrowser.Common/Extensions/CollectionExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Extensions/CollectionExtensions.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Extensions/CollectionExtensions.cs b/MediaBrowser.Common/Extensions/CollectionExtensions.cs new file mode 100644 index 000000000..f7c0e3cf0 --- /dev/null +++ b/MediaBrowser.Common/Extensions/CollectionExtensions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace MediaBrowser.Common.Extensions +{ + // The MS CollectionExtensions are only available in netcoreapp + public static class CollectionExtensions + { + public static TValue GetValueOrDefault<TKey, TValue> (this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key) + { + dictionary.TryGetValue(key, out var ret); + return ret; + } + } +} |
