Newtonsoft.Json - DeserializeObject throws when deserializing custom type: Error converting value “somestring” to type CustomType
问题 I have a custom type: [TypeConverter(typeof(FriendlyUrlTypeConverter))] public class FriendlyUrl : IEquatable<FriendlyUrl>, IConvertible { public FriendlyUrl() { _friendlyUrl = string.Empty; } public FriendlyUrl(string value) { value = value.Trim(); if (!FriednlyUrlValidator.Validate(value)) throw new FriendlyUrlValidationException("Invalid value for FrienlyUrl"); _friendlyUrl = value; } public static implicit operator FriendlyUrl(string friendlyUrlValue) { if (friendlyUrlValue != "" &&