【发布时间】:2013-06-30 16:56:08
【问题描述】:
再见。
我的 WebApi 控制器中有一个带有实体框架的 JSON 输出。 如下所示:
"Answers":[{"Text":"text text text"},{"Text":"text text text"},{"Text":"text text text"}]}]
我想这样展示它:
"Answers":["text text text","text text text","text text text"]
这是我的实体模型(答案类):
public class Answers
{
[Key]
[JsonIgnore]
public int Id { get; set; }
public string Text { get; set; }
// An Answers related to a Question
public virtual Question Question { get; set; }
}
【问题讨论】:
标签: c# json entity-framework asp.net-web-api