I have reviewed every similar article I can find here and tried anything that looked like it might work with no success (obv since I am now asking the question).
I have a webAPI 2.0 controller with a POST action that takes in an object of type Reservation
. This object contains, among other things, a property called Items
which is of type EquipmentItems
. As you can imagine, this is a List property. I send the reservation object over (using PostAsJsonAsync("api/Reservation", reservation).Result
if it matters to anyone).
When I land in the API controller, the Reservation
object is completely populated with everything except what is in the EquipmentItems
property.
In the spirit of full disclosure, the Items
property within the Reservation
class, is actually defined as a List where T is IItemData
interface. EquimpentItem
inherits from IItemData
tho, so not sure if that complicates matters.
Can the native controller deserializer not handle List where T is interface?
What I know does work is defining the List as a regular array. That works very well, but I have other requirements that have navigated me towards using List.
Any suggestions on how to get that List property deserialized correctly?