C# Web api中的参数值始终为空

C# Web api中的参数值始终为空,c#,http,asp.net-web-api,.net-core,http-put,C#,Http,Asp.net Web Api,.net Core,Http Put,我正在从angular 7向dotnetcore webapi中的webapi put方法发送put请求中的数据。但每次我得到的都是null而不是实际值 请参阅下面的snipet 提出卖出请求 控制器中的方法 发送的数据 CustomerService.put() 通过在发布数据之前取消序列化数据来解决此问题。问题在于Cosigner模型,如上图所示,它是一个JSON序列化对象,但控制器希望它是Cosigner类型的普通对象。这就是为什么控制器拒绝发布的数据并显示空值。向我们显示customer

我正在从angular 7向dotnetcore webapi中的webapi put方法发送put请求中的数据。但每次我得到的都是
null
而不是实际值

请参阅下面的snipet

提出卖出请求 控制器中的方法 发送的数据 CustomerService.put()
通过在发布数据之前取消序列化数据来解决此问题。问题在于Cosigner模型,如上图所示,它是一个JSON序列化对象,但控制器希望它是Cosigner类型的普通对象。这就是为什么控制器拒绝发布的数据并显示空值。

向我们显示
customerService.put
方法和
DTO.Customer
class@DiPix共享服务方法和的副本DTO@ikramf90数据和显示的类不匹配。
this.customerService.put(this.customer).subscribe(result => {
    // doing something here
});
 [HttpPut]
 [Route("update")]
 public dynamic UpdateCustomer([FromBody]DTO.Customer customer)
{
        // customer is null, instead of getting posted data.
}
{
  "id": 1,
  "identityId": "542d4b93-4afb-4ee0-a433-c0794bb6ce05",
  "identity": {
    "firstName": "John",
    "lastName": "Doe",
    "pictureUrl": null,
    "role": 0,
    "id": "542d4b93-4afb-4ee0-a433-c0794bb6ce05",
    "userName": "JohnDoes@test.com",
    "normalizedUserName": "JOHNDOES@TEST.COM",
    "email": "JohnDoes@test.com",
    "normalizedEmail": "JOHNDOES@TEST.COM",
    "emailConfirmed": false,
    "passwordHash": "AQAAAAEAACcQAAAAEIEt4AjVwpIi0BEuhS7SJFrsa5NAuLn/fuE61Drvgm863cIw5ua+DTl2A/EHsamW+A==",
    "securityStamp": "565e8576-0b33-4613-9843-b032c908e4ba",
    "concurrencyStamp": "43c71a17-680f-45fb-b6b2-8374db1624fa",
    "phoneNumber": "0",
    "phoneNumberConfirmed": false,
    "twoFactorEnabled": false,
    "lockoutEnd": null,
    "lockoutEnabled": true,
    "accessFailedCount": 0
  },
  "location": null,
  "locale": null,
  "gender": null,
  "home_Address": null,
  "residing_Address": null,
  "home_City": null,
  "residing_City": null,
  "residing_State": null,
  "home_State": null,
  "birthDate": null,
  "joiningDate": null,
  "educationDetails": "null",
  "cosigner": "{\"CosignerName\":\"jhg\",\"CosingerPhoneNumber\":78955422,\"CosignerEmploymentStatus\":1,\"CosignerEmail\":\"test@test.com\",\"WorkPermitLeft\":20,\"MonthlySalary\":2500.0,\"Address\":\"mkbgiygyi\"}",
  "bankStatement": null,
  "finance": "null",
  "home_Country": null,
  "residing_Country": null,
  "phone": 0,
  "fax": null,
  "graduationType": null,
  "graduationStream": null,
  "panNumber": 0,
  "postalCode": null,
  "application": []
}
put(path: string, body: Object = {}): Observable<any> {
    return this.httpClient.put(`${path}`,JSON.stringify(body),this.httpOptions);
  }
 public class Customer
  {
    public int Id { get; set; }
    public CosignerDetails Cosigner { get; set; }

  // some other properties
  // above props. are of interest among others
  }

public class CosignerDetails{
   public int Id { get; set; }
   public string Name { get; set; }

   // some other properties
}