【发布时间】:2012-12-08 11:39:08
【问题描述】:
将带有嵌套对象的对象传递给我的 ASP.NET Web API GET 方法的 URL 语法是什么?这可能吗?
http://mydomain/mycontroller?...
Mycontroller GET 方法:
public void Get([FromUri]MyType myType) { ... }
C# 类型:
public class MyType
{
public string Name { get; set; }
public NestedType Foo { get; set; }
}
public class NestedType
{
public int Bar { get; set; }
}
【问题讨论】:
-
这看起来像是一个有趣的相关讨论:stackoverflow.com/questions/7104578/…
标签: c# url rest asp.net-web-api