STAGE 2 OK
This commit is contained in:
@@ -44,19 +44,22 @@ public class appellationController : BaseApiController
|
||||
public IHttpActionResult GetList([FromBody] Model.appellation q,
|
||||
int page, int pageSize = 10, string sortBy = "", bool sortDesc = false)
|
||||
{
|
||||
var qry = _db.appellations.AsEnumerable();
|
||||
var qry = _db.appellations.AsQueryable();
|
||||
|
||||
|
||||
qry = qry.OrderBy(o => o.num);
|
||||
|
||||
var count = qry.Count();
|
||||
var qryList = (pageSize > 0) ? qry.ToPagedList(page, pageSize).ToList() : qry.ToList();
|
||||
|
||||
var ret = new
|
||||
{
|
||||
list = qry.ToPagedList(page, pageSize).Select(x => new
|
||||
list = qryList.Select(x => new
|
||||
{
|
||||
num = x.num,
|
||||
title = x.title,
|
||||
}),
|
||||
count = qry.Count()
|
||||
count = count
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user