Qui*_*ver 1 .net c# asp.net-mvc json
我的控制器中有以下JsonResult:
public JsonResult SearchRxNormDrugs(string term)
{
var matches = rxnConsoService.SearchRxNormDrugs(term);
return Json(matches, JsonRequestBehavior.AllowGet);
}
Run Code Online (Sandbox Code Playgroud)
在调试项目时,我可以看到它matches有300多个结果.所有比赛都有内容.但是,当我在url中导航到此操作时,我得到的结果如下:
模型:
public class RxNConso
{
[KeyProperty(Identity = true)]
string RXCUI { get; set; }
string LAT { get; set; }
string TS { get; set; }
string LUI { get; set; }
string STT { get; set; }
string SUI { get; set; }
string ISPREF { get; set; }
string RXAUI { get; set; }
string SAUI { get; set; }
string SCUI { get; set; }
string SDUI { get; set; }
string SAB { get; set; }
string TTY { get; set; }
string CODE { get; set; }
string STR { get; set; }
string SRL { get; set; }
string SUPPRESS { get; set; }
string CVF { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
matches是IEnumerable的RxNConso
IEnumerable<RxNConso> matches
Run Code Online (Sandbox Code Playgroud)
是什么导致这个?
大多数序列化库仅关注可公开访问的属性/字段.您的类可能只有私有字段/属性,这可以解释为什么您可以在调试器中查看值,但在序列化时获得空结果.
| 归档时间: |
|
| 查看次数: |
1466 次 |
| 最近记录: |