Method FromJsonString
FromJsonString(string, TimeSpan, TimeSpan, RateBase)
Deserializes a JSON String to a Rate64OnDateTime instance.
public static Rate64OnDateTime FromJsonString(string rateHelperSerialized, TimeSpan minDelta, TimeSpan maxDelta, RateBase rateBase = RateBase.Second)
Parameters
rateHelperSerializedstringSerialized Rate64OnDateTime instance.
minDeltaTimeSpanMinimum TimeSpan necessary between 2 counters when calculating a rate.
Counters will be buffered until this minimum delta is met.maxDeltaTimeSpanMaximum TimeSpan allowed between 2 counters when calculating a rate.
rateBaseRateBaseChoose whether the rate should be calculated per second, minute, hour or day.
Returns
- Rate64OnDateTime
If the
rateHelperSerializedis valid, a new instance of the Rate64OnDateTime class with all data found inrateHelperSerialized.
Otherwise, throws a JsonReaderException.
Exceptions
- JsonReaderException
rateHelperSerializedis an invalid string representation of a Rate64OnDateTime instance.