Esempio n. 1
0
        public static Guid GetGuid(this EnvelopeHeaders obj, string key)
        {
            if (obj.TryGetValue(key, out var v) && v is JsonString s && Guid.TryParse(s.ToString(), out var guid))
            {
                return(guid);
            }

            return(default);
Esempio n. 2
0
        public static long GetLong(this EnvelopeHeaders obj, string key)
        {
            if (obj.TryGetValue(key, out var v))
            {
                if (v is JsonNumber number)
                {
                    return((long)number.Value);
                }
                else if (v.Type == JsonValueType.String && double.TryParse(v.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out var result))
                {
                    return((long)result);
                }
            }

            return(0);
        }