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())); }
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"); } }
public override Version Parse(DbValue item) => Version.Parse(item.ToString());
public override Uri Parse(DbValue item) => new Uri(item.ToString());
public object ToObject(DbValue item, IMember member) { var text = item.ToString(); return(JsonArray.Parse(text)); }
public object ToObject(DbValue item, IMember member) => JsonObject.Parse(item.ToString());
public object ToObject(DbValue item, IMember member) { return(item.ToString()); }