我试图发送这个JSON对象
{"from":{"Lat":30.075027703750937,"Lng":31.342577639657264,"Type":0},
"to":{"Lat":30.021339759652712,"Lng":31.284893204137528,"Type":0}}
到此Web API 2方法
[HttpPut]
public IHttpActionResult PutTicketDestination(Guid Id, [FromBody] Location from, [FromBody] Location to)
位置对象
public class Location
{
public Location();
public Location(double lat, double lng, LocationType type);
public double Lat { get; set; }
public double Lng { get; set; }
public LocationType Type { get; set; }
}
public enum LocationType
{
Degree = 0,
Radias = 1
}
但我得到
无法将多个参数(来自'和'')绑定到请求中 内容。
当我使用Postman发送此PUT请求时,请求URL中发送了Id
api/Tickets/PutTicketDestination/00000000-0000-0000-0000-0000000000000
无法确定我在这里做错了什么