コード例 #1
0
        public async Task <IActionResult> HeadAsync()
        {
            var urlBases      = _urlBaseBuilder.Build(Request);
            var linkTemplates = _linkTemplatesBuilder.Build(urlBases);

            Response.Headers.Add(LinkTemplateHeader, linkTemplates);
            return(Ok());
        }
コード例 #2
0
        public string Build <TItem>(IPage <TItem> page, HttpRequest request)
        {
            if (page == null)
            {
                throw new ArgumentNullException(nameof(page));
            }
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }
            var urlBases = _urlBaseBuilder.Build(request);
            var links    = _linksFormatter.GetLinks(urlBases.ReadUrl, page);

            return(links);
        }