David Jovanovski
Json to enum deserialization issue
Can someone explain why does my controller not deserialize enum property but does for a List of that same enum in the same object?? this is the object:
public class CommunityReportFilter
{
public List<RentalMetrics>? RentalMetrics { get; set; }
public RentalMetrics? PrimaryMetric { get; set; }
}
This is the payload:
"rentalMetrics": [
"effRent"
],
"primaryMetric:": "effRent"
list passes the value down but PrimaryMetric is null. Controller is configured to deserialize camelCased strings to enum
19 replies