Exemplo n.º 1
0
        private void CreateLinksForPatients(LinkedResourceBaseDto wrapper,
                                            string orderBy, string facilityName, int pageNumber, int pageSize, bool hasNext, bool hasPrevious)
        {
            wrapper.Links.Add(
                new LinkDto(
                    _linkGeneratorService.CreatePatientsResourceUri(ResourceUriType.Current, orderBy, facilityName, pageNumber, pageSize),
                    "self", "GET"));

            if (hasNext)
            {
                wrapper.Links.Add(
                    new LinkDto(
                        _linkGeneratorService.CreatePatientsResourceUri(ResourceUriType.NextPage, orderBy, facilityName, pageNumber, pageSize),
                        "nextPage", "GET"));
            }

            if (hasPrevious)
            {
                wrapper.Links.Add(
                    new LinkDto(
                        _linkGeneratorService.CreatePatientsResourceUri(ResourceUriType.PreviousPage, orderBy, facilityName, pageNumber, pageSize),
                        "previousPage", "GET"));
            }
        }