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; }
}