I'm using the new WebApi which is part of MVC4 beta. I have the following class:
public class Voucher
{
public string Id { get; set; }
public string TableId { get; set; }
public Product[] Products { get; set; }
}
My controller looks like this:
public class VouchersController : ApiController
{
public Voucher PostVoucher(Voucher voucher)
{
//....
}
}
On the client side I serialize the data using an XmlSerializer
. The output looks like expected and the Products
array is serialized. If I post the data and put a break point inside the PostVoucher
method, I get the data for Id
and TableId
, but Products
is null
. Any hint what I might be doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…