Class DiscordJson
Represents discord json.
Inheritance
System.Object
DiscordJson
Namespace: DisCatSharp.Net.Serialization
Assembly: DisCatSharp.dll
Syntax
public static class DiscordJson
Methods
| Improve this Doc View SourcePopulateObject(JToken, Object)
Populates an object with the values from a JSON node.
Declaration
public static void PopulateObject(JToken value, object target)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.JToken | value | The token to populate the object with. |
System.Object | target | The object to populate. |
SerializeObject(Object)
Serializes the specified object to a JSON string.
Declaration
public static string SerializeObject(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The object to serialize. |
Returns
Type | Description |
---|---|
System.String | A JSON string representation of the object. |
ToDiscordObject<T>(JToken)
Converts this token into an object, passing any properties through extra Newtonsoft.Json.JsonConverters if needed.
Declaration
public static T ToDiscordObject<T>(this JToken token)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.JToken | token | The token to convert |
Returns
Type | Description |
---|---|
T | The converted token |
Type Parameters
Name | Description |
---|---|
T | Type to convert to |