Closed jtsai-dev closed 1 year ago
i am trying to map string to Guid, and i also hope it could be deal with empty string, so i set the config like this
TypeAdapterConfig<string, Guid>.NewConfig() .Map(dest => dest, src => src == "" ? Guid.Empty : Guid.Parse(src));
but it still throw an exception System.FormatException:“Unrecognized Guid format.” when Adapt empty string var gid = "".Adapt<Guid>(); , is there a configuration i am missing?
System.FormatException:“Unrecognized Guid format.”
var gid = "".Adapt<Guid>();
just ignore this question, i had saw the MapWith for this case
MapWith
i am trying to map string to Guid, and i also hope it could be deal with empty string, so i set the config like this
but it still throw an exception
System.FormatException:“Unrecognized Guid format.”
when Adapt empty stringvar gid = "".Adapt<Guid>();
, is there a configuration i am missing?