JsonExtensions
Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class JsonExtensions
Methods
JsonTo<T>(Dictionary<String, String>, String)
View Source
Declaration
public static T JsonTo<T>(this Dictionary<string, string> map, string key)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.String> | map |
System.String | key |
Type Parameters
T
Get<T>(Dictionary<String, String>, String, T)
Get JSON string value converted to T
View Source
Declaration
public static T Get<T>(this Dictionary<string, string> map, string key, T defaultValue = null)
Returns
<T>
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.String> | map |
System.String | key |
<T> | defaultValue |
Type Parameters
T
GetArray<T>(Dictionary<String, String>, String)
View Source
Declaration
public static T[] GetArray<T>(this Dictionary<string, string> map, string key)
Returns
<T>[]
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.String> | map |
System.String | key |
Type Parameters
T
Get(Dictionary<String, String>, String)
Get JSON string value
View Source
Declaration
public static string Get(this Dictionary<string, string> map, string key)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Collections.Generic.Dictionary<System.String,System.String> | map |
System.String | key |
ArrayObjects(String)
View Source
Declaration
public static JsonArrayObjects ArrayObjects(this string json)
Returns
ServiceStack.Text.JsonArrayObjects
Parameters
Type | Name |
---|---|
System.String | json |
ConvertAll<T>(JsonArrayObjects, Func<JsonObject, T>)
View Source
Declaration
public static List<T> ConvertAll<T>(this JsonArrayObjects jsonArrayObjects, Func<JsonObject, T> converter)
Returns
System.Collections.Generic.List<<T>>
Parameters
Type | Name |
---|---|
ServiceStack.Text.JsonArrayObjects | jsonArrayObjects |
System.Func<ServiceStack.Text.JsonObject,<T>> | converter |
Type Parameters
T
ConvertTo<T>(JsonObject, Func<JsonObject, T>)
View Source
Declaration
public static T ConvertTo<T>(this JsonObject jsonObject, Func<JsonObject, T> convertFn)
Returns
<T>
Parameters
Type | Name |
---|---|
ServiceStack.Text.JsonObject | jsonObject |
System.Func<ServiceStack.Text.JsonObject,<T>> | convertFn |
Type Parameters
T
ToDictionary(JsonObject)
View Source
Declaration
public static Dictionary<string, string> ToDictionary(this JsonObject jsonObject)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Text.JsonObject | jsonObject |