0

I want to read this field from my JSON:

create_date: "2020-06-07 15:24:23"

This is the property in my class

public DateTime? expire_date { get; set; }

But this method JsonSeializer.Deserialize can't map this and I get this exception:

The converter specified on 'expire_date' does not derive from JsonConverter or have a public parameterless constructor

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

-1

Declare your expire_date as a string if u can. If u cant do that define a new class with same variables except expire_date . Define expire_date as a string in new class . Than deserialize object with new class. After that u can parse string datetime value and assign your class.

Sadullah DOĞAN
  • 335
  • 2
  • 10