0

不知道从哪里开始,我想写我返回到 json 的结果

当前代码:

   public Setting TestSettings(Example _example, String type)
    {
        var results = _example.GetExample("Testing");
        return results;
    }

设定模型

string Description { get; set; }
Guid? Guid1 { get; set; }
Guid? Guid2 { get; set; }
string Key { get; set; }
string Value { get; set; }

获取示例

public Setting GetExample(string key)
        {
            using (var db = MyDataContext.StoredProcs)
            {
                return db.GetExample<Setting>(key, _curGuid1, _curGuid2, SettingExtensions.SettingFactory());
            }
    }
4

1 回答 1

0

你可以试试这个

 var resultslist = _example.GetExample("Testing");

 var result = new DataSourceResult()
 {
    Data = resultslist 
 };
 return Json(result, JsonRequestBehavior.AllowGet);
于 2013-08-06T12:19:21.677 回答