0
我使用SyncFusion Asp.Net MVC網格,在此我想在服務器端進行過濾和JSON發送到服務器,如下Asp.net MVC5 JSON值I結合scafolding
但在視圖模型,其中對象propertis來了爲空沒有約束力
的Json
{"select":["Area","Id"],"where":[{"isComplex":false,"field":"Area","operator":"startswith","value":"test","ignoreCase":true}],"sorted":[{"name":"Area","direction":"ascending"}]}
我已經創建的模型如下,這是傳遞給控制器,但它不具有約束力。
public class UserViewModel
{
public int skip { get; set; }
public int take { get; set; }
public Sort sorted { get; set; }
public string[] group { get; set; }
//Grid Action Params;
public string action { get; set; }
public string key { get; set; }
public string keyColumn { get; set; }
public string[] select { get; set; }
public Search search { get; set; }
public Where where { get; set; }
public ApplicationUser value { get; set; }
}
public class Where
{
public bool isComplex { get; set; }
public string field { get; set; }
public string @operator { get; set; }
public string @value { get; set; }
public bool ignoreCase { get; set; }
}
public class Sort
{
public string name { get; set; }
public string direction { get; set; }
// "sorted":[{"name":"Area","direction":"ascending"}],"group":["Area"]
}
public class Search
{
public string[] fields { get; set; }
public string @operator { get; set; }
public string key { get; set; }
public bool ignoreCase { get; set; }
}
控制器方法
public async Task<ActionResult> DataSource(UserViewModel editParams)
{
}