diff options
author | Rob Mensching <rob@firegiant.com> | 2017-11-11 01:40:34 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2017-11-11 01:40:34 -0800 |
commit | 414bf166e07703056ad186fa8ec23a4119dd9993 (patch) | |
tree | 960aa302bcc3b7d80db3f2cdd87462251790f091 /src/WixToolset.Data/Json | |
parent | 69b15d96cebdbb7201b1849b4f62786633d70b8d (diff) | |
download | wix-414bf166e07703056ad186fa8ec23a4119dd9993.tar.gz wix-414bf166e07703056ad186fa8ec23a4119dd9993.tar.bz2 wix-414bf166e07703056ad186fa8ec23a4119dd9993.zip |
Additional IR updates
Diffstat (limited to 'src/WixToolset.Data/Json')
-rw-r--r-- | src/WixToolset.Data/Json/JsonObjectExtensions.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Json/JsonObjectExtensions.cs b/src/WixToolset.Data/Json/JsonObjectExtensions.cs index 091d90f4..296a7ab6 100644 --- a/src/WixToolset.Data/Json/JsonObjectExtensions.cs +++ b/src/WixToolset.Data/Json/JsonObjectExtensions.cs | |||
@@ -12,6 +12,11 @@ namespace WixToolset.Data | |||
12 | return jsonObject.TryGetValue(key, out var value) ? Convert.ToInt32(value) : defaultValue; | 12 | return jsonObject.TryGetValue(key, out var value) ? Convert.ToInt32(value) : defaultValue; |
13 | } | 13 | } |
14 | 14 | ||
15 | public static int? GetValueOrDefault(this JsonObject jsonObject, string key, int? defaultValue) | ||
16 | { | ||
17 | return jsonObject.TryGetValue(key, out var value) ? Convert.ToInt32(value) : defaultValue; | ||
18 | } | ||
19 | |||
15 | public static T GetValueOrDefault<T>(this JsonObject jsonObject, string key, T defaultValue = default(T)) where T : class | 20 | public static T GetValueOrDefault<T>(this JsonObject jsonObject, string key, T defaultValue = default(T)) where T : class |
16 | { | 21 | { |
17 | return jsonObject.TryGetValue(key, out var value) ? value as T: defaultValue; | 22 | return jsonObject.TryGetValue(key, out var value) ? value as T: defaultValue; |