Support Prompt.Input<Guid>
kimsey0 opened this issue · comments
Jacob Bundgaard commented
It would be useful to be able to read GUIDs like:
var resourceId = Prompt.Input<Guid>("Please enter resource ID");
However, this fails since Convert.ChangeType
can't convert from string
to Guid
at
It might perhaps be implemented by instead using TypeDescriptor.GetConverter(_underlyingType ?? _targetType).ConvertFrom(value)
or TypeDescriptor.GetConverter(_underlyingType ?? _targetType).ConvertFromInvariantString(value)
, which would then delegate to GuidConverter for GUIDs, though the effect on other types, like floating point numbers, would of course have to be considered.
Tatsuro Shibamura commented
Thank you. This change looks good to me.
Tatsuro Shibamura commented
It has been improved to v2.3.3
. Thank you!
Jacob Bundgaard commented
Thank you!