在我的 Web API 控制器中,我将结果返回给方法调用,如下所示:
// GET api/profile/5
public VCompleteProjectProfile GetBasicProjectProfile(int id)
{
return _dbss.GetBasicProfile(id);
}
这是实际结果:
{
"$id":"1",
"Id":1,
"ProjectName":"Caribbean Challenge",
"IsMrRcSelected":true,
"IsMrdProject":true,
"RegionName":"North America",
"EntityKey":{
"$id":"2",
"EntitySetName":"VCompleteProjectProfile",
"EntityContainerName":"MrdViewEntities",
"EntityKeyValues":[
{"Key":"Id","Type":"System.Int32","Value":"1"},
{"Key":"ProjectName","Type":"System.String","Value":"Caribbean Challenge"},
{"Key":"IsMrRcSelected","Type":"System.Boolean","Value":"True"}
]
}
}
有可能压制EntityKey
吗?如果是这样,怎么做?这是MVC4。
谢谢埃里克