Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 1c3fa0f

Browse files
authored
Merge pull request #495 from chriswebb/vs2015
JsonObject helper class missing non-generic ConvertTo function overload
2 parents 6f863ed + e41901c commit 1c3fa0f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ServiceStack.Text/JsonObject.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,11 @@ private static bool IsJavaScriptNumber(string strValue)
178178
}
179179

180180
public T ConvertTo<T>()
181+
{
182+
return (T)this.ConvertTo(typeof(T));
183+
}
184+
185+
public object ConvertTo(Type type)
181186
{
182187
var map = new Dictionary<string, object>();
183188

@@ -186,7 +191,7 @@ public T ConvertTo<T>()
186191
map[entry.Key] = entry.Value;
187192
}
188193

189-
return (T)map.FromObjectDictionary(typeof(T));
194+
return map.FromObjectDictionary(type);
190195
}
191196
}
192197

0 commit comments

Comments
 (0)