How to default-ly instantiate null values while deserializing with RestSharp.
For example you have this POCO
public class Address {
public string Street { get; set; }
public string City { get; set; }
public int Number { get; set; }
public string Postal { get; set; }
}
public class Root {
public string Name { get; set; }
public Address Address { get; set; }
}
And this JSON:
{
"Root": {
"Name" : "John",
"Address" : null
}
}
Is it possible when I do RestClient.ExecuteAsGet<Root>( ... ), that even though the Address is null, it still gets instantiated (new Address())?