Exemplo n.º 1
0
        public object ToObject(DbValue item, IMember member)
        {
            // Parse strings to allow graceful migration to integers

            if (item.Kind == DbValueType.S)
            {
                return(Enum.Parse(member.Type, item.ToString()));
            }

            return(Enum.ToObject(member.Type, item.ToInt()));
        }
Exemplo n.º 2
0
        public override IPAddress Parse(DbValue item)
        {
            switch (item.Kind)
            {
            case DbValueType.S: return(IPAddress.Parse(item.ToString()));

            case DbValueType.B: return(new IPAddress(item.ToBinary()));

            default: throw new ConversionException($"Cannot DB type: {item.Kind} to IPAddress");
            }
        }
Exemplo n.º 3
0
 public override Version Parse(DbValue item) => Version.Parse(item.ToString());
Exemplo n.º 4
0
 public override Uri Parse(DbValue item) => new Uri(item.ToString());
Exemplo n.º 5
0
        public object ToObject(DbValue item, IMember member)
        {
            var text = item.ToString();

            return(JsonArray.Parse(text));
        }
Exemplo n.º 6
0
 public object ToObject(DbValue item, IMember member) =>
 JsonObject.Parse(item.ToString());
Exemplo n.º 7
0
 public object ToObject(DbValue item, IMember member)
 {
     return(item.ToString());
 }