Exemplo n.º 1
0
        private void CreateLinksForCausalityReport(
            LinkedResourceBaseDto wrapper,
            Guid workFlowGuid,
            int pageNumber, int pageSize,
            int facilityId, CausalityCriteria causalityCriteria,
            bool hasNext, bool hasPrevious)
        {
            wrapper.Links.Add(
                new LinkDto(
                    _linkGeneratorService.CreateCausalityReportResourceUri(workFlowGuid, ResourceUriType.Current, pageNumber, pageSize, facilityId, causalityCriteria),
                    "self", "GET"));

            if (hasNext)
            {
                wrapper.Links.Add(
                    new LinkDto(
                        _linkGeneratorService.CreateCausalityReportResourceUri(workFlowGuid, ResourceUriType.NextPage, pageNumber, pageSize, facilityId, causalityCriteria),
                        "nextPage", "GET"));
            }

            if (hasPrevious)
            {
                wrapper.Links.Add(
                    new LinkDto(
                        _linkGeneratorService.CreateCausalityReportResourceUri(workFlowGuid, ResourceUriType.PreviousPage, pageNumber, pageSize, facilityId, causalityCriteria),
                        "previousPage", "GET"));
            }
        }