Beispiel #1
0
        public override async Task <ApiResult> GetListPages([FromQuery] KeyListQuery keyListQuery)
        {
            Expression <Func <Site, bool> > whereExpression = null;

            if (!string.IsNullOrEmpty(keyListQuery.Key))
            {
                whereExpression = d => d.Title.Contains(keyListQuery.Key);
            }
            var res = await _service.GetPagesAsync(keyListQuery.Page, keyListQuery.Limit, whereExpression, d => d.Id, false);

            return(new ApiResult(data: new { count = res.TotalItems, items = res.Items }));
        }
Beispiel #2
0
        public virtual async Task <ApiResult> GetListPages([FromQuery] TListQuery listQuery)
        {
            var res = await _service.GetPagesAsync(listQuery.Page, listQuery.Limit);

            return(new ApiResult(data: new { count = res.TotalItems, items = res.Items }));
        }
Beispiel #3
0
        public virtual async Task <ApiResult> GetListPages([FromQuery] TListQuery listQuery)
        {
            var res = await _service.GetPagesAsync(listQuery.Page, listQuery.Limit, d => d.SiteId == listQuery.SiteId && d.Status == true, d => d.Id, false);

            return(new ApiResult(data: new { count = res.TotalItems, items = res.Items }));
        }