public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var token = JToken.ReadFrom(reader); return(new Money( _reader.ReadAmount(token, serializer.ContractResolver), _reader.ReadCurrencyCode(token, serializer.ContractResolver))); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Money?money = default(Money?); var token = JToken.ReadFrom(reader); if (token.HasValues) { money = new Money( _reader.ReadAmount(token, serializer.ContractResolver), _reader.ReadCurrencyCode(token, serializer.ContractResolver)); } return(MoneyReader.AdaptNullables(objectType, money)); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var token = JToken.ReadFrom(reader); Money?read = default(Money?); if (token.HasValues) { read = new Money( _reader.ReadAmount(token, serializer.ContractResolver), _reader.ReadCurrencyCode(token, serializer.ContractResolver)); } return(read); }