I'm liking the look of this. Taking a stab at raising a PR for it.
Silly list of value converter candidates for possible consideration or more likely outright rejection.
A candidate could have a public constructor taking a single primitive type, or a have a static Parse method taking a single primitive type.
With your own value converter:
var uriConverter = new ValueConverter<Uri, string>(v => v.ToString(), v => new Uri(v));
Or with backing fields for those who want.
public class Server
{
private string _iPAddress;
public IPAddress IPAddress
{
get { return IPAddress.Parse(_iPAddress); }
set { _iPAddress = value.ToString(); }
}
}
The IPAddress is now in EF Core thanks to @ralmsdeveloper with pull request #20679.
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-5.0/whatsnew#ipaddress-mapping
PhysicalAddress is now in EF Core thanks to @ralmsdeveloper.
https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-5.0/whatsnew#physicaladdress-mapping
Somle more possible candidates:
Most helpful comment
I'm liking the look of this. Taking a stab at raising a PR for it.