public List <AdmissionNewsResponseDto> GetAdmissionNews(AdmissionNewsConditionSearch conditionSearch)
        {
            // Nếu không tồn tại điều kiện tìm kiếm thì khởi tạo giá trị tìm kiếm ban đầu
            if (conditionSearch == null)
            {
                conditionSearch = new AdmissionNewsConditionSearch();
            }

            // Lấy các thông tin dùng để phân trang
            var paging = new Paging(db.AdmissionNews.Count(x => !x.DelFlag &&
                                                           (conditionSearch.KeySearch == null ||
                                                            (conditionSearch.KeySearch != null && (x.Title.Contains(conditionSearch.KeySearch)))))
                                    , conditionSearch.CurrentPage, conditionSearch.PageSize);

            // Tìm kiếm và lấy dữ liệu theo trang
            var listOfNews = db.AdmissionNews.Where(x => !x.DelFlag &&
                                                    (conditionSearch.KeySearch == null ||
                                                     (conditionSearch.KeySearch != null && (x.Title.Contains(conditionSearch.KeySearch)))))
                             .OrderBy(x => x.Id)
                             .Skip((paging.CurrentPage - 1) * paging.PageSize)
                             .Take(paging.PageSize).Select(x => new AdmissionNewsResponseDto
            {
                Id        = x.Id,
                Title     = x.Title,
                ImageUrl  = x.ImageUrl,
                Summary   = x.Summary,
                Content   = x.Content,
                CreatedAt = x.CreatedAt
            }).ToList();

            return(listOfNews == null ? null : listOfNews);
        }
 public IHttpActionResult GetAdmissionNews([FromBody] AdmissionNewsConditionSearch conditionSearch)
 {
     try
     {
         return(Ok(_admissionNewsService.GetAdmissionNews(conditionSearch)));
     }
     catch (System.Exception e)
     {
         return(InternalServerError(e));
     }
 }