【发布时间】:2016-01-22 00:14:35
【问题描述】:
我有以下 Get API
public class FooController
{
public IHttpActionResult Get([FromUri] FooCriteria criteria) { ... }
}
public class FooCriteria
{
public string Baz { get; set; }
public Location Location { get; set; }
}
public class Location
{
public double Latitude { get; set; }
public double Longitude { get; set; }
}
我一生都无法弄清楚 Uri 的格式以正确传递嵌套的复杂类型。
到目前为止,我有http://localhost:8957/api/Foo/?Baz=hello& WHAT GOES HERE。
【问题讨论】:
标签: c# asp.net-web-api get uri complextype