Вот пример параметра заказа, который отправляется на сервер:
Код: Выделить всё
&order[0][column]=1&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1618229879540
Код контроллера:
Код: Выделить всё
[HttpGet]
public async Task GetAudits([FromQuery]DataTableParams dataTableParams)
{
var audits = await _auditRepository.GetAuditsAsync(dataTableParams);
return Ok(audits);
}
Код: Выделить всё
public class DataTableParams
{
public int Draw { get; set; }
public int Start { get; set; }
public int Length { get; set; } = 30;
public string Dir { get; set; }
public IEnumerable Order { get; set;}
}
public class DtOrder
{
///
/// Column to which ordering should be applied.
/// This is an index reference to the columns array of information that is also submitted to the server.
///
public int Column { get; set; }
///
/// Ordering direction for this column.
/// It will be dt-string asc or dt-string desc to indicate ascending ordering or descending ordering, respectively.
///
public string Dir { get; set; }
}
Подробнее здесь: https://stackoverflow.com/questions/670 ... -in-net-co
Мобильная версия