gpt4 book ai didi

json - 如何读取此Json到 Controller 对象? Kendo UI网格服务器过滤

转载 作者:行者123 更新时间:2023-12-02 03:57:34 25 4
gpt4 key购买 nike

我正在尝试过滤Kendo UI网格服务器端过滤器。开发人员工具在查询字符串中显示此内容

/ Home / GetUsmMessage?{“filter”:{“logic”:“and”,“filters” [{“field”:“MessageId”,“operator”:“eq”,“value”:1}]},“组”:[]} GET 200 application / json

我创建了一个对象结构,以便将结构读取为对象

    public ActionResult GetUsmMessage(FilterContainer filter)
{
//Code to read the filter container
return Json(jsonData, JsonRequestBehavior.AllowGet);
}

过滤器容器的对象结构:
public class FilterContainer
{
public List<FilterDescription> filters { get; set; }
public string logic { get; set; }
}
public class FilterDescription
{
public string @operator { get; set; }
public string field { get; set; }
public string value { get; set; }

public List<FilterDescription> filters { get; set; }
public string logic { get; set; }
}

当我调试 Controller 功能时,它仍然给我一个空对象。请帮忙

最佳答案

得到答案...我忘了添加请求类型作为Http post ....

关于json - 如何读取此Json到 Controller 对象? Kendo UI网格服务器过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11919716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com