Exemplo n.º 1
0
        public ActionResult <Api <List <LogDTO> > > GetAllLog(             //
            [FromQuery(Name = "page"), DefaultValue(1)] int page,          //
            [FromQuery(Name = "page_limit"), DefaultValue(10), ] int limit //
            )
        {
            int totalItems = _logService.CountAll();

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

            List <LogDTO> dtos = _logService.FindAll(page, limit);

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

            return(Ok(result));
        }