public ApiResponse Index([FromQuery] Query query, [FromHeader] Header header)
        {
            if (query.Pagination)
            {
                List <PermissionRepository> permissionsRepo = this.permissionApplication.GetList(query.Search, query.Page, query.PerPage);
                int             count       = this.permissionApplication.Count(query.Search);
                decimal         pageInCount = ((decimal)count) / query.PerPage;
                PaginationModel paginate    = new PaginationModel()
                {
                    TotalPage = (int)Math.Ceiling(pageInCount),
                    Page      = query.Page,
                    PerPage   = query.PerPage,
                    Data      = PermissionItem.MapRepo(permissionsRepo),
                    Total     = count
                };

                return(new ApiResponsePagination(HttpStatusCode.OK, paginate));
            }
            else
            {
                var permissionsRepo = this.permissionApplication.GetList(query.Search, query.Page, query.PerPage);
                return(new ApiResponseDataList(HttpStatusCode.OK, permissionsRepo, permissionsRepo.Count));
            }
        }