Пример #1
0
        public ActionResult <Api <List <ShiftDTO> > > GetAll(               //
            [FromQuery(Name = "page"), DefaultValue(1), Required] int page, //
            [FromQuery(Name = "page_limit"), DefaultValue(10), ] int limit  //
            )
        {
            int totalItems = _shiftService.CountAll();

            int totalPages = (int)Math.Ceiling((double)totalItems / limit);

            List <ShiftDTO> dtos = _shiftService.FindAll(page, limit);

            Api <List <ShiftDTO> > result = new Api <List <ShiftDTO> >(200, dtos, "Success", new Paging(page, limit, totalPages, totalItems));

            return(Ok(result));
        }