Class Converters
Helper functions for deserialization and conversion
public static class Converters
- Inheritance
-
Converters
- Inherited Members
Methods
ToDateTime(double)
Converts an epoch into a DateTime
public static DateTime ToDateTime(this double epoch)
Parameters
epoch
double
Returns
ToDateTime(ulong?)
Converts an epoch into a DateTime
public static DateTime? ToDateTime(this ulong? epoch)
Parameters
epoch
ulong?
Returns
ToDateTime(ulong)
Converts an epoch into a DateTime
public static DateTime ToDateTime(this ulong epoch)
Parameters
epoch
ulong
Returns
ToJson(object)
Serializes an object instance into json, using snake casing and ignoring nulls
public static string ToJson(this object o)
Parameters
o
object
Returns
ToObject<T>(string)
Deserializes a json string into the specified type, expecting snake casing
public static T? ToObject<T>(this string json)
Parameters
json
stringJSON
Returns
- T
Deserialized instance
Type Parameters
T
The desired type
ToTimestamp(DateTime)
Converts a DateTime object to an epoch integer
public static ulong ToTimestamp(this DateTime epoch)
Parameters
epoch
DateTime