Example #1
0
        public async Task <IActionResult> GetBaiTuyenDung([FromQuery] string keywords       = null,
                                                          [FromQuery] Pagination pagination = null)
        {
            var query        = _baiTuyenDungService.GetBaiTuyenDung(keywords);
            var baiTuyenDung = PagedList.Create(query, pagination.Page - 1, pagination.ItemsPerPage);

            pagination.TotalItems = baiTuyenDung.TotalCount;
            var result = new PagedResult <BaiTuyenDungDTO>(pagination, baiTuyenDung.Select(BaiTuyenDungDTO.FromEntity));

            return(Ok(result));
        }
Example #2
0
        public async Task <IActionResult> GetBaiTuyenDung([FromQuery] string keywords       = null /*, int? doanhNghiepId = null*/,
                                                          [FromQuery] Pagination pagination = null)
        //[FromQuery] int? doanhNghiepId = null)
        {
            var query        = _baiTuyenDungService.GetBaiTuyenDung(keywords /*, doanhNghiepId*/);
            var baiTuyenDung = PagedList.Create(query, pagination.Page - 1, pagination.ItemsPerPage);

            pagination.TotalItems = baiTuyenDung.TotalCount;
            //var baiTuyenDungDTO = baiTuyenDung.Select(x => new BaiTuyenDungDTO
            //{
            //    Id = x.Id,
            //    TieuDe = x.TieuDe,
            //    KyHieu = x.KyHieu,
            //});
            var result = new PagedResult <BaiTuyenDungDTO>(pagination, baiTuyenDung.Select(BaiTuyenDungDTO.FromEntity));

            return(Ok(result));
        }