Class JsonSerializerExtension
- Namespace
- Hi3Helper.Plugin.Core.Utility.Json
- Assembly
- Hi3Helper.Plugin.Core.dll
public static class JsonSerializerExtension
- Inheritance
-
JsonSerializerExtension
- Inherited Members
-
Methods
GetApiResponseFromJsonAsync<T>(HttpClient, string, JsonTypeInfo<T?>, HttpMethod?, CancellationToken)
public static Task<T> GetApiResponseFromJsonAsync<T>(this HttpClient client, string url, JsonTypeInfo<T?> typeInfo, HttpMethod? httpMethod = null, CancellationToken token = default)
Parameters
client HttpClient
url string
typeInfo JsonTypeInfo<T>
httpMethod HttpMethod
token CancellationToken
Returns
- Task<T>
Type Parameters
T
GetApiResponseFromJsonAsync<T>(HttpClient, string, JsonTypeInfo<T?>, CancellationToken)
public static Task<T> GetApiResponseFromJsonAsync<T>(this HttpClient client, string url, JsonTypeInfo<T?> typeInfo, CancellationToken token = default)
Parameters
client HttpClient
url string
typeInfo JsonTypeInfo<T>
token CancellationToken
Returns
- Task<T>
Type Parameters
T
GetConfigValue<T>(JsonObject?, string)
public static T? GetConfigValue<T>(this JsonObject? obj, string propertyName)
Parameters
obj JsonObject
propertyName string
Returns
- T
Type Parameters
T
SetConfigValueIfEmpty<T>(JsonObject, string, T?, JsonTypeInfo<T>?)
public static void SetConfigValueIfEmpty<T>(this JsonObject obj, string propertyName, T? value, JsonTypeInfo<T>? typeInfo = null)
Parameters
obj JsonObject
propertyName string
value T
typeInfo JsonTypeInfo<T>
Type Parameters
T
SetConfigValue<T>(JsonObject, string, T?, JsonTypeInfo<T>?)
public static void SetConfigValue<T>(this JsonObject obj, string propertyName, T? value, JsonTypeInfo<T>? typeInfo = null)
Parameters
obj JsonObject
propertyName string
value T
typeInfo JsonTypeInfo<T>
Type Parameters
T