因此,如果我有一个 PersonController 和一个 CompanyController 并且我调用 www.example.com/api/person?id=34 它将返回嵌入到 person xml 中的人和公司,如下所示:
<Person xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Example.Models">
<Name>John Smith</Name>
<PersonId>34</PersonId>
<Company>
<Name>Blah</Name>
</Company>
</Person>
这将如何在 mvc 4 中完成,谢谢。