aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Installer/Code/ModelExtensions.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-15 17:38:24 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-15 17:38:24 -0400
commitb4c06b76c139c79fac33c05699ae3bbc0124ffdf (patch)
tree29edc51be480df4d59e74170324c00ae8a57cf53 /MediaBrowser.Installer/Code/ModelExtensions.cs
parent3a1317fd4fd0030c50ff7011a329ce689583d1b6 (diff)
parentc37825aa123ecc4e9b06a3c108f2cc1ee144a392 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Installer/Code/ModelExtensions.cs')
-rw-r--r--MediaBrowser.Installer/Code/ModelExtensions.cs43
1 files changed, 0 insertions, 43 deletions
diff --git a/MediaBrowser.Installer/Code/ModelExtensions.cs b/MediaBrowser.Installer/Code/ModelExtensions.cs
deleted file mode 100644
index 66e51ec11..000000000
--- a/MediaBrowser.Installer/Code/ModelExtensions.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-
-using System.Collections.Generic;
-
-namespace MediaBrowser.Installer.Code
-{
- /// <summary>
- /// Class ModelExtensions
- /// </summary>
- static class ModelExtensions
- {
- /// <summary>
- /// Values the or default.
- /// </summary>
- /// <param name="str">The STR.</param>
- /// <param name="def">The def.</param>
- /// <returns>System.String.</returns>
- public static string ValueOrDefault(this string str, string def = "")
- {
- return string.IsNullOrEmpty(str) ? def : str;
- }
-
- /// <summary>
- /// Helper method for Dictionaries since they throw on not-found keys
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <typeparam name="U"></typeparam>
- /// <param name="dictionary">The dictionary.</param>
- /// <param name="key">The key.</param>
- /// <param name="defaultValue">The default value.</param>
- /// <returns>``1.</returns>
- public static U GetValueOrDefault<T, U>(this Dictionary<T, U> dictionary, T key, U defaultValue)
- {
- U val;
- if (!dictionary.TryGetValue(key, out val))
- {
- val = defaultValue;
- }
- return val;
-
- }
-
- }
-}