我已经编写了一个 ASP.Net Web API,我要求显示基于参数的完整/一些结果 (s) JSON,即,verbose=true解释这个要求。我目前的 JSON 是无需冗长获取方法:api/v1/患者?密钥=1{ "user": { "key": 1, "suffix": "1", "firstName": "Dhanu", "lastName": "Kumar", "middleName": "", "address": { "address1": "uuu", "address2": "TTT", "address3": "xx", "city": "yy" } }}带有冗长的api/v1/patient?Key=1&verbose=true{ "user": { "key": 1, "firstName": "Dhanu", "lastName": "Kumar", "middleName": "" }}我的用户.cspublic UserDTO(){ public int Key { get; set; } public string Suffix { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string MiddleName { get; set; } public Address Address {get;set;} }基于详细参数,我将隐藏/显示 JSON 中的一些字段。有没有办法实现这一目标?
1 回答
- 1 回答
- 0 关注
- 163 浏览
添加回答
举报
0/150
提交
取消