aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Extensions/CollectionExtensions.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-03-07 21:08:57 +0100
committerGitHub <noreply@github.com>2019-03-07 21:08:57 +0100
commit10a0d6bdba821449abfb1d48e9708ba6f3fc6a62 (patch)
tree602be322daedca127ba66de07837ac8e792730a7 /MediaBrowser.Common/Extensions/CollectionExtensions.cs
parentae0ecc1b10982d9240ecdcc82cb7299fc708aafb (diff)
parent0abe57e930e44eab9566991f33b089d1e61cfb83 (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.cs14
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;
+ }
+ }
+}