public static void Main()
Console.WriteLine("Hello World");
var json = @"{""B"":42.0}";
var p2 = JsonConvert.DeserializeObject<A>(json, new CustomIntConverter());
p2 = JsonConvert.DeserializeObject<A>(json, new CustomIntConverter());
public class CustomIntConverter : JsonConverter<int>
public override void WriteJson(JsonWriter writer, int value, JsonSerializer serializer)
writer.WriteValue(value.ToString());
public override int ReadJson(JsonReader reader, Type objectType, int existingValue, bool hasExistingValue, JsonSerializer serializer)
int i = Convert.ToInt32(reader.Value);