0
以下JSON对象映射正确。它将所有字段映射到我的Web API模型(partNumbersReturned数组除外)。 Web API上的模型是否看起来不一样?这里是JSON对象:具有数组的复杂JSON对象不映射到Web API模型?
$scope.carbForm =
{
ownerInformation:
{
fullName: "",
email: "",
street1: "",
street2: "",
city: "",
state: "",
zip: ""
},
newOwnerInformation:
{
fullName: "",
email: "",
street1: "",
street2: "",
city: "",
state: "",
zip: ""
},
vehicleInformation: {
vin: "",
vehicleMake: "",
vehicleModel: "",
vehicleYear: ""
},
productInformation: {
productStatus: "",
otherExplanation: "",
partNumbersReturned: []
}
};
这里是我的Web API型号:
public class CarbForm
{
public int Id { get; set; }
public VehicleInformation VehicleInformation { get; set; }
public OwnerInformation OwnerInformation { get; set; }
public NewOwnerInformation NewOwnerInformation { get; set; }
public ProductInformation ProductInformation { get; set; }
}
的ProductInformation的定义是这样的:
public class ProductInformation
{
public string ProductStatus { get; set; }
public string OtherExplanation { get; set; }
public List<string> PartNumbersReturned { get; set; }
}