Add ODB mapping registration for IPv6

pull/2/head
Harald Wolff 2019-10-07 09:06:53 +02:00
parent 02503a5908
commit baaffcdea6
1 changed files with 5 additions and 0 deletions

View File

@ -107,6 +107,11 @@ namespace ln.types.odb.ng
RegisterMapping<IPv4>(
(mapper, value) => new ODBUInteger(value.AsUInt),
(mapper, oval) => new IPv4(oval.As<uint>())
);
RegisterMapping<IPv6>(
(mapper, value) => new ODBByteBuffer(value.ToCIDRBytes()),
(mapper, oval) => new IPv6((oval.As<byte[]>()))
);
ObjectMapping = new mappings.ObjectMapping();