Пример #1
0
        public static void FromJson(JToken json, out string algorithm, out HashRate hashRate)
        {
            var jsonProperty = (JProperty)json;

            algorithm = jsonProperty.Name;
            hashRate  = new HashRate(jsonProperty.Value.Value <double>(), Metric.Unit);
        }
Пример #2
0
 public static JProperty ToJson(this string algorithm, HashRate hashRate) =>
 new JProperty(algorithm, hashRate.Convert(Metric.Unit).Value);